diff --git a/internal/binder/referenceresolver.go b/internal/binder/referenceresolver.go index d915378e852..2a4781d263c 100644 --- a/internal/binder/referenceresolver.go +++ b/internal/binder/referenceresolver.go @@ -17,7 +17,7 @@ type ReferenceResolver interface { type ReferenceResolverHooks struct { ResolveName func(location *ast.Node, name string, meaning ast.SymbolFlags, nameNotFoundMessage *diagnostics.Message, isUse bool, excludeGlobals bool) *ast.Symbol - GetResolvedSymbol func(*ast.Node) *ast.Symbol + GetCachedResolvedSymbol func(*ast.Node) *ast.Symbol GetMergedSymbol func(*ast.Symbol) *ast.Symbol GetParentOfSymbol func(*ast.Symbol) *ast.Symbol GetSymbolOfDeclaration func(*ast.Declaration) *ast.Symbol @@ -41,10 +41,10 @@ func NewReferenceResolver(options *core.CompilerOptions, hooks ReferenceResolver } } -func (r *referenceResolver) getResolvedSymbol(node *ast.Node) *ast.Symbol { +func (r *referenceResolver) getCachedResolvedSymbol(node *ast.Node) *ast.Symbol { if node != nil { - if r.hooks.GetResolvedSymbol != nil { - return r.hooks.GetResolvedSymbol(node) + if r.hooks.GetCachedResolvedSymbol != nil { + return r.hooks.GetCachedResolvedSymbol(node) } } return nil @@ -81,7 +81,7 @@ func (r *referenceResolver) getSymbolOfDeclaration(declaration *ast.Declaration) } func (r *referenceResolver) getReferencedValueSymbol(reference *ast.IdentifierNode, startInDeclarationContainer bool) *ast.Symbol { - resolvedSymbol := r.getResolvedSymbol(reference) + resolvedSymbol := r.getCachedResolvedSymbol(reference) if resolvedSymbol != nil { return resolvedSymbol } @@ -250,7 +250,7 @@ func (r *referenceResolver) GetElementAccessExpressionName(expression *ast.Eleme func (r *referenceResolver) GetReferencedMemberValueDeclaration(node *ast.Node) *ast.Declaration { // member references are `this.something` or `this[something]`, so should always simply have a resolved symbol - s := r.getResolvedSymbol(node) + s := r.getCachedResolvedSymbol(node) if s == nil && node.Symbol() != nil { // might be a declaration instead of a ref, get the merged declaration symbol s = r.getMergedSymbol(node.Symbol()) diff --git a/internal/checker/checker.go b/internal/checker/checker.go index 020fe611931..19b905564cc 100644 --- a/internal/checker/checker.go +++ b/internal/checker/checker.go @@ -2982,7 +2982,7 @@ func (c *Checker) checkTypeReferenceOrImport(node *ast.Node) { c.checkTypeArgumentConstraints(node, typeParameters) } } - symbol := c.getResolvedSymbolOrNil(node) + symbol := c.getCachedResolvedSymbol(node) if symbol != nil { if core.Some(symbol.Declarations, func(d *ast.Node) bool { return ast.IsTypeDeclaration(d) && c.IsDeprecatedDeclaration(d) }) { c.addDeprecatedSuggestion(c.getDeprecatedSuggestionNode(node), symbol.Declarations, symbol.Name) @@ -3815,7 +3815,7 @@ func (c *Checker) checkTestingKnownTruthyType(condExpr *ast.Node, condType *Type if location != condExpr { t = c.checkExpression(location) } - if t.flags&TypeFlagsEnumLiteral != 0 && ast.IsPropertyAccessExpression(location) && core.OrElse(c.getResolvedSymbolOrNil(location.Expression()), c.unknownSymbol).Flags&ast.SymbolFlagsEnum != 0 { + if t.flags&TypeFlagsEnumLiteral != 0 && ast.IsPropertyAccessExpression(location) && core.OrElse(c.getCachedResolvedSymbol(location.Expression()), c.unknownSymbol).Flags&ast.SymbolFlagsEnum != 0 { // EnumLiteral type at condition with known value is always truthy or always falsy, likely an error c.error(location, diagnostics.This_condition_will_always_return_0, core.IfElse(evaluator.IsTruthy(t.AsLiteralType().value), "true", "false")) return @@ -8135,7 +8135,7 @@ func (c *Checker) checkElementAccessExpression(node *ast.Node, exprType *Type, c core.IfElse(c.isGenericObjectType(objectType) && !isThisTypeParameter(objectType), AccessFlagsNoIndexSignatures, 0) } indexedAccessType := core.OrElse(c.getIndexedAccessTypeOrUndefined(objectType, effectiveIndexType, accessFlags, node, nil), c.errorType) - return c.checkIndexedAccessIndexType(c.getFlowTypeOfAccessExpression(node, c.getResolvedSymbolOrNil(node), indexedAccessType, indexExpression, checkMode), node) + return c.checkIndexedAccessIndexType(c.getFlowTypeOfAccessExpression(node, c.getCachedResolvedSymbol(node), indexedAccessType, indexExpression, checkMode), node) } // Return true if given node is an expression consisting of an identifier (possibly parenthesized) @@ -9937,7 +9937,7 @@ func (c *Checker) invocationErrorDetails(errorTarget *ast.Node, apparentType *Ty headMessage := core.IfElse(isCall, diagnostics.This_expression_is_not_callable, diagnostics.This_expression_is_not_constructable) // Diagnose get accessors incorrectly called as functions if ast.IsCallExpression(errorTarget.Parent) && len(errorTarget.Parent.Arguments()) == 0 { - resolvedSymbol := c.getResolvedSymbolOrNil(errorTarget) + resolvedSymbol := c.getCachedResolvedSymbol(errorTarget) if resolvedSymbol != nil && resolvedSymbol.Flags&ast.SymbolFlagsGetAccessor != 0 { headMessage = diagnostics.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without } @@ -10766,7 +10766,7 @@ func (c *Checker) checkDeleteExpression(node *ast.Node) *Type { if ast.IsPropertyAccessExpression(expr) && ast.IsPrivateIdentifier(expr.Name()) { c.error(expr, diagnostics.The_operand_of_a_delete_operator_cannot_be_a_private_identifier) } - symbol := c.getExportSymbolOfValueSymbolIfExported(c.getResolvedSymbolOrNil(expr)) + symbol := c.getExportSymbolOfValueSymbolIfExported(c.getCachedResolvedSymbol(expr)) if symbol != nil { if c.isReadonlySymbol(symbol) { c.error(expr, diagnostics.The_operand_of_a_delete_operator_cannot_be_a_read_only_property) @@ -11209,7 +11209,7 @@ func (c *Checker) checkPropertyAccessChain(node *ast.Node, checkMode CheckMode) } func (c *Checker) checkPropertyAccessExpressionOrQualifiedName(node *ast.Node, left *ast.Node, leftType *Type, right *ast.Node, checkMode CheckMode, writeOnly bool) *Type { - parentSymbol := c.getResolvedSymbolOrNil(left) + parentSymbol := c.getCachedResolvedSymbol(left) assignmentKind := getAssignmentTargetKind(node) widenedType := leftType if assignmentKind != AssignmentKindNone || c.isMethodAccessForCall(node) { @@ -13789,7 +13789,7 @@ func (c *Checker) checkExpressionForMutableLocation(node *ast.Node, checkMode Ch } } -func (c *Checker) getResolvedSymbol(node *ast.Node) *ast.Symbol { +func (c *Checker) getResolvedSymbol(node *ast.IdentifierNode) *ast.Symbol { links := c.symbolNodeLinks.Get(node) if links.resolvedSymbol == nil { var symbol *ast.Symbol @@ -13802,7 +13802,7 @@ func (c *Checker) getResolvedSymbol(node *ast.Node) *ast.Symbol { return links.resolvedSymbol } -func (c *Checker) getResolvedSymbolOrNil(node *ast.Node) *ast.Symbol { +func (c *Checker) getCachedResolvedSymbol(node *ast.Node) *ast.Symbol { return c.symbolNodeLinks.Get(node).resolvedSymbol } @@ -14880,7 +14880,7 @@ func (c *Checker) getTargetOfAliasLikeExpression(expression *ast.Node) *ast.Symb return aliasLike } c.checkExpressionCached(expression) - return c.getResolvedSymbolOrNil(expression) + return c.getCachedResolvedSymbol(expression) } func (c *Checker) getTargetOfNamespaceExportDeclaration(node *ast.Node) *ast.Symbol { @@ -17041,7 +17041,7 @@ func (c *Checker) getInferredTypeParameterConstraint(t *Type, omitTypeReferences func (c *Checker) getTypeParametersForTypeReferenceOrImport(node *ast.Node) []*Type { t := c.getTypeFromTypeNode(node) if !c.isErrorType(t) { - symbol := c.getResolvedSymbolOrNil(node) + symbol := c.getCachedResolvedSymbol(node) if symbol != nil { return c.getTypeParametersForTypeAndSymbol(t, symbol) } @@ -28045,8 +28045,16 @@ func isInternalModuleImportEqualsDeclaration(node *ast.Node) bool { } func (c *Checker) markIdentifierAliasReferenced(location *ast.IdentifierNode) { - symbol := c.getResolvedSymbol(location) - if symbol != nil && symbol != c.argumentsSymbol && symbol != c.unknownSymbol && !ast.IsThisInTypeQuery(location) { + if ast.IsThisInTypeQuery(location) { + return + } + symbol := c.getCachedResolvedSymbol(location) + if symbol == nil { + // lookup, no diagnostics + symbol = c.resolveName(location, location.AsIdentifier().Text, ast.SymbolFlagsValue|ast.SymbolFlagsExportValue, + nil, !ast.IsWriteOnlyAccess(location), false /*excludeGlobals*/) + } + if symbol != nil && symbol != c.argumentsSymbol && symbol != c.unknownSymbol { c.markAliasReferenced(symbol, location) } } @@ -31433,7 +31441,7 @@ func (c *Checker) getSymbolOfNameOrPropertyAccessExpression(name *ast.Node) *ast possibleImportNode := isImportTypeQualifierPart(name) if possibleImportNode != nil { c.getTypeFromTypeNode(possibleImportNode) - sym := c.getResolvedSymbolOrNil(name) + sym := c.getCachedResolvedSymbol(name) return core.IfElse(sym == c.unknownSymbol, nil, sym) } } diff --git a/internal/checker/emitresolver.go b/internal/checker/emitresolver.go index 23ee3c3eb64..3e0d094e47b 100644 --- a/internal/checker/emitresolver.go +++ b/internal/checker/emitresolver.go @@ -823,7 +823,7 @@ func (r *EmitResolver) getReferenceResolver() binder.ReferenceResolver { if r.referenceResolver == nil { r.referenceResolver = binder.NewReferenceResolver(r.checker.compilerOptions, binder.ReferenceResolverHooks{ ResolveName: r.checker.resolveName, - GetResolvedSymbol: r.checker.getResolvedSymbolOrNil, + GetCachedResolvedSymbol: r.checker.getCachedResolvedSymbol, GetMergedSymbol: r.checker.getMergedSymbol, GetParentOfSymbol: r.checker.getParentOfSymbol, GetSymbolOfDeclaration: r.checker.getSymbolOfDeclaration, diff --git a/internal/checker/flow.go b/internal/checker/flow.go index 84c0d81e8f1..3c94811c783 100644 --- a/internal/checker/flow.go +++ b/internal/checker/flow.go @@ -1800,7 +1800,7 @@ func (c *Checker) isConstantReference(node *ast.Node) bool { case ast.KindPropertyAccessExpression, ast.KindElementAccessExpression: // The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here. if c.isConstantReference(node.Expression()) { - symbol := c.getResolvedSymbolOrNil(node) + symbol := c.getCachedResolvedSymbol(node) if symbol != nil { return c.isReadonlySymbol(symbol) } diff --git a/internal/diagnostics/diagnostics.go b/internal/diagnostics/diagnostics.go index f03594c9007..971632afbef 100644 --- a/internal/diagnostics/diagnostics.go +++ b/internal/diagnostics/diagnostics.go @@ -148,3 +148,12 @@ func StringifyArgs(args []any) []string { } return result } + +func NewAdHocMessage(message string) *Message { + return &Message{ + code: -1, + category: CategoryError, + key: "-1", + text: message, + } +} diff --git a/internal/execute/incremental/program.go b/internal/execute/incremental/program.go index fc69fcff488..e6ddf8bb6f3 100644 --- a/internal/execute/incremental/program.go +++ b/internal/execute/incremental/program.go @@ -197,7 +197,6 @@ func (p *Program) GetSuggestionDiagnostics(ctx context.Context, file *ast.Source return p.program.GetSuggestionDiagnostics(ctx, file) // TODO: incremental suggestion diagnostics (only relevant in editor incremental builder?) } -// GetModeForUsageLocation implements compiler.AnyProgram interface. func (p *Program) Emit(ctx context.Context, options compiler.EmitOptions) *compiler.EmitResult { p.panicIfNoProgram("Emit") diff --git a/internal/testutil/harnessutil/harnessutil.go b/internal/testutil/harnessutil/harnessutil.go index a2e6ac4881e..959fbbeca06 100644 --- a/internal/testutil/harnessutil/harnessutil.go +++ b/internal/testutil/harnessutil/harnessutil.go @@ -598,6 +598,21 @@ func createCompilerHost(fs vfs.FS, defaultLibraryPath string, currentDirectory s } } +func getAllDiagnostics(ctx context.Context, program compiler.ProgramLike, captureSuggestions bool) []*ast.Diagnostic { + var diags []*ast.Diagnostic + diags = append(diags, program.GetProgramDiagnostics()...) + diags = append(diags, program.GetSyntacticDiagnostics(ctx, nil)...) + diags = append(diags, program.GetSemanticDiagnostics(ctx, nil)...) + diags = append(diags, program.GetGlobalDiagnostics(ctx)...) + if program.Options().GetEmitDeclarations() { + diags = append(diags, program.GetDeclarationDiagnostics(ctx, nil)...) + } + if captureSuggestions { + diags = append(diags, program.GetSuggestionDiagnostics(ctx, nil)...) + } + return compiler.SortAndDeduplicateDiagnostics(diags) +} + func compileFilesWithHost( host compiler.CompilerHost, config *tsoptions.ParsedCommandLine, @@ -618,62 +633,62 @@ func compileFilesWithHost( // delete compilerOptions.project; // } - // !!! Need `getPreEmitDiagnostics` program for this // pre-emit/post-emit error comparison requires declaration emit twice, which can be slow. If it's unlikely to flag any error consistency issues // and if the test is running `skipLibCheck` - an indicator that we want the tets to run quickly - skip the before/after error comparison, too - // skipErrorComparison := len(rootFiles) >= 100 || options.SkipLibCheck == core.TSTrue && options.Declaration == core.TSTrue - // var preProgram *compiler.Program - // if !skipErrorComparison { - // preProgram = ts.createProgram({ rootNames: rootFiles || [], options: { ...compilerOptions, configFile: compilerOptions.configFile, traceResolution: false }, host, typeScriptVersion }) - // } - // let preErrors = preProgram && ts.getPreEmitDiagnostics(preProgram); - // if (preProgram && harnessOptions.captureSuggestions) { - // preErrors = ts.concatenate(preErrors, ts.flatMap(preProgram.getSourceFiles(), f => preProgram.getSuggestionDiagnostics(f))); - // } + skipErrorComparison := len(config.FileNames()) >= 100 || config.CompilerOptions().SkipLibCheck == core.TSTrue && config.CompilerOptions().Declaration == core.TSTrue - // const program = ts.createProgram({ rootNames: rootFiles || [], options: compilerOptions, host, harnessOptions.typeScriptVersion }); - // const emitResult = program.emit(); - // let postErrors = ts.getPreEmitDiagnostics(program); - // !!! Need `getSuggestionDiagnostics` for this - // if (harnessOptions.captureSuggestions) { - // postErrors = ts.concatenate(postErrors, ts.flatMap(program.getSourceFiles(), f => program.getSuggestionDiagnostics(f))); - // } - // const longerErrors = ts.length(preErrors) > postErrors.length ? preErrors : postErrors; - // const shorterErrors = longerErrors === preErrors ? postErrors : preErrors; - // const errors = preErrors && (preErrors.length !== postErrors.length) ? [ - // ...shorterErrors!, - // ts.addRelatedInfo( - // ts.createCompilerDiagnostic({ - // category: ts.DiagnosticCategory.Error, - // code: -1, - // key: "-1", - // message: `Pre-emit (${preErrors.length}) and post-emit (${postErrors.length}) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here!`, - // }), - // ts.createCompilerDiagnostic({ - // category: ts.DiagnosticCategory.Error, - // code: -1, - // key: "-1", - // message: `The excess diagnostics are:`, - // }), - // ...ts.filter(longerErrors!, p => !ts.some(shorterErrors, p2 => ts.compareDiagnostics(p, p2) === ts.Comparison.EqualTo)), - // ), - // ] : postErrors; ctx := context.Background() - program := createProgram(host, config) - var diagnostics []*ast.Diagnostic - diagnostics = append(diagnostics, program.GetProgramDiagnostics()...) - diagnostics = append(diagnostics, program.GetSyntacticDiagnostics(ctx, nil)...) - diagnostics = append(diagnostics, program.GetSemanticDiagnostics(ctx, nil)...) - diagnostics = append(diagnostics, program.GetGlobalDiagnostics(ctx)...) - if config.CompilerOptions().GetEmitDeclarations() { - diagnostics = append(diagnostics, program.GetDeclarationDiagnostics(ctx, nil)...) - } - if harnessOptions.CaptureSuggestions { - diagnostics = append(diagnostics, program.GetSuggestionDiagnostics(ctx, nil)...) + var preErrors []*ast.Diagnostic + if !skipErrorComparison { + preCompilerOptions := config.CompilerOptions().Clone() + preCompilerOptions.TraceResolution = core.TSFalse + preConfig := &tsoptions.ParsedCommandLine{ + ParsedConfig: &core.ParsedOptions{ + CompilerOptions: preCompilerOptions, + FileNames: config.FileNames(), + }, + ConfigFile: config.ConfigFile, + Errors: config.Errors, + } + preProgram := createProgram(host, preConfig) + preErrors = getAllDiagnostics(ctx, preProgram, harnessOptions.CaptureSuggestions) + } + + postProgram := createProgram(host, config) + // Force checking to happen before emit, otherwise emit may mutate checker state in a way that affects diagnostics. + _ = getAllDiagnostics(ctx, postProgram, harnessOptions.CaptureSuggestions) + emitResult := postProgram.Emit(ctx, compiler.EmitOptions{}) + postErrors := getAllDiagnostics(ctx, postProgram, harnessOptions.CaptureSuggestions) + + errors := postErrors + if !skipErrorComparison && len(postErrors) != len(preErrors) { + longerErrors := postErrors + shorterErrors := preErrors + if len(preErrors) > len(postErrors) { + longerErrors, shorterErrors = preErrors, postErrors + } + diag := ast.NewCompilerDiagnostic( + diagnostics.NewAdHocMessage(fmt.Sprintf("Pre-emit (%d) and post-emit (%d) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here!", len(preErrors), len(postErrors))), + ) + diag = diag.AddRelatedInfo(ast.NewCompilerDiagnostic(diagnostics.NewAdHocMessage("The excess diagnostics are:"))) + for _, d := range longerErrors { + matched := false + for _, d2 := range shorterErrors { + comparison := ast.CompareDiagnostics(d, d2) + if comparison == 0 { + matched = true + break + } + } + if !matched { + diag = diag.AddRelatedInfo(d) + } + } + errors = shorterErrors + errors = append(errors, diag) } - emitResult := program.Emit(ctx, compiler.EmitOptions{}) - return newCompilationResult(host, config.CompilerOptions(), program, emitResult, diagnostics, harnessOptions) + return newCompilationResult(host, config.CompilerOptions(), postProgram, emitResult, errors, harnessOptions) } type CompilationResult struct { diff --git a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt index 6c99ac7a37d..a60545c3cf4 100644 --- a/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/constructorWithIncompleteTypeAnnotation.errors.txt @@ -1,5 +1,5 @@ +error TS-1: Pre-emit (92) and post-emit (93) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. -constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@ -93,7 +93,10 @@ constructorWithIncompleteTypeAnnotation.ts(259,55): error TS1005: ';' expected. constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or statement expected. -==== constructorWithIncompleteTypeAnnotation.ts (93 errors) ==== +!!! error TS-1: Pre-emit (92) and post-emit (93) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS7017 constructorWithIncompleteTypeAnnotation.ts:239:29: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. +==== constructorWithIncompleteTypeAnnotation.ts (92 errors) ==== declare module "fs" { export class File { constructor(filename: string); @@ -107,8 +110,6 @@ constructorWithIncompleteTypeAnnotation.ts(261,1): error TS1128: Declaration or import fs = module("fs"); ~~~~~~ !!! error TS2503: Cannot find namespace 'module'. - ~~~~~~ -!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: ';' expected. diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport(target=es2015).errors.txt index 1826289e037..393c2cf32d7 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport(target=es2015).errors.txt @@ -1,16 +1,13 @@ declarationEmitUnknownImport.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. -declarationEmitUnknownImport.ts(1,14): error TS2304: Cannot find name 'SomeNonExistingName'. declarationEmitUnknownImport.ts(1,14): error TS2503: Cannot find namespace 'SomeNonExistingName'. declarationEmitUnknownImport.ts(2,9): error TS2303: Circular definition of import alias 'Foo'. -==== declarationEmitUnknownImport.ts (4 errors) ==== +==== declarationEmitUnknownImport.ts (3 errors) ==== import Foo = SomeNonExistingName ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'Foo'. ~~~~~~~~~~~~~~~~~~~ -!!! error TS2304: Cannot find name 'SomeNonExistingName'. - ~~~~~~~~~~~~~~~~~~~ !!! error TS2503: Cannot find namespace 'SomeNonExistingName'. export {Foo} ~~~ diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt index f52b6fd9af9..1574a8f625f 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt @@ -1,20 +1,17 @@ declarationEmitUnknownImport2.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. declarationEmitUnknownImport2.ts(1,12): error TS1005: '=' expected. -declarationEmitUnknownImport2.ts(1,12): error TS2304: Cannot find name 'From'. declarationEmitUnknownImport2.ts(1,12): error TS2503: Cannot find namespace 'From'. declarationEmitUnknownImport2.ts(1,17): error TS1005: ';' expected. declarationEmitUnknownImport2.ts(2,1): error TS2303: Circular definition of import alias 'Foo'. -==== declarationEmitUnknownImport2.ts (6 errors) ==== +==== declarationEmitUnknownImport2.ts (5 errors) ==== import Foo From './Foo'; // Syntax error ~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'Foo'. ~~~~ !!! error TS1005: '=' expected. ~~~~ -!!! error TS2304: Cannot find name 'From'. - ~~~~ !!! error TS2503: Cannot find namespace 'From'. ~~~~~~~ !!! error TS1005: ';' expected. diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.errors.txt b/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.errors.txt index 12e30795fff..21a5afeb0d8 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithClassModifiers.errors.txt @@ -1,15 +1,18 @@ +error TS-1: Pre-emit (6) and post-emit (9) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module or namespace element. -importDeclWithClassModifiers.ts(5,26): error TS2708: Cannot use namespace 'x' as a value. importDeclWithClassModifiers.ts(5,28): error TS2694: Namespace 'x' has no exported member 'c'. importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module or namespace element. -importDeclWithClassModifiers.ts(6,27): error TS2708: Cannot use namespace 'x' as a value. importDeclWithClassModifiers.ts(6,29): error TS2694: Namespace 'x' has no exported member 'c'. importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module or namespace element. -importDeclWithClassModifiers.ts(7,26): error TS2708: Cannot use namespace 'x' as a value. importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no exported member 'c'. -==== importDeclWithClassModifiers.ts (9 errors) ==== +!!! error TS-1: Pre-emit (6) and post-emit (9) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2708 importDeclWithClassModifiers.ts:5:26: Cannot use namespace 'x' as a value. +!!! related TS2708 importDeclWithClassModifiers.ts:6:27: Cannot use namespace 'x' as a value. +!!! related TS2708 importDeclWithClassModifiers.ts:7:26: Cannot use namespace 'x' as a value. +==== importDeclWithClassModifiers.ts (6 errors) ==== namespace x { interface c { } @@ -17,22 +20,16 @@ importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no export export public import a = x.c; ~~~~~~ !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. - ~ -!!! error TS2708: Cannot use namespace 'x' as a value. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export private import b = x.c; ~~~~~~~ !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. - ~ -!!! error TS2708: Cannot use namespace 'x' as a value. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export static import c = x.c; ~~~~~~ !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. - ~ -!!! error TS2708: Cannot use namespace 'x' as a value. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. var b: a; diff --git a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt index d4420d401f2..3a77d8319e7 100644 --- a/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt @@ -1,16 +1,17 @@ -importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2708: Cannot use namespace 'x' as a value. +error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. -==== importDeclWithExportModifierAndExportAssignment.ts (3 errors) ==== +!!! error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2708 importDeclWithExportModifierAndExportAssignment.ts:5:19: Cannot use namespace 'x' as a value. +==== importDeclWithExportModifierAndExportAssignment.ts (2 errors) ==== namespace x { interface c { } } export import a = x.c; - ~ -!!! error TS2708: Cannot use namespace 'x' as a value. ~ !!! error TS2694: Namespace 'x' has no exported member 'c'. export = x; diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt b/testdata/baselines/reference/submodule/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt new file mode 100644 index 00000000000..025dc6a25d6 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt @@ -0,0 +1,15 @@ +error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + + +!!! error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2708 internalAliasInterfaceInsideTopLevelModuleWithExport.ts:6:19: Cannot use namespace 'a' as a value. +==== internalAliasInterfaceInsideTopLevelModuleWithExport.ts (0 errors) ==== + export namespace a { + export interface I { + } + } + + export import b = a.I; + export var x: b; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt b/testdata/baselines/reference/submodule/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt new file mode 100644 index 00000000000..94568e64c86 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt @@ -0,0 +1,20 @@ +error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + + +!!! error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2708 internalAliasUninitializedModuleInsideLocalModuleWithExport.ts:10:23: Cannot use namespace 'a' as a value. +==== internalAliasUninitializedModuleInsideLocalModuleWithExport.ts (0 errors) ==== + export namespace a { + export namespace b { + export interface I { + foo(); + } + } + } + + export namespace c { + export import b = a.b; + export var x: b.I; + x.foo(); + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt b/testdata/baselines/reference/submodule/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt index dbe8496dc4b..6ed52a9dfe7 100644 --- a/testdata/baselines/reference/submodule/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt @@ -1,6 +1,13 @@ +error TS-1: Pre-emit (1) and post-emit (5) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! multiLinePropertyAccessAndArrowFunctionIndent1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. +!!! error TS-1: Pre-emit (1) and post-emit (5) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:1:18: Cannot find name 'role'. +!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:2:18: Cannot find name 'Role'. +!!! related TS2503 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:26: Cannot find namespace 'ng'. +!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:53: Cannot find name 'Role'. ==== multiLinePropertyAccessAndArrowFunctionIndent1.ts (1 errors) ==== return this.edit(role) ~~~~~~ diff --git a/testdata/baselines/reference/submodule/compiler/parseErrorIncorrectReturnToken.errors.txt b/testdata/baselines/reference/submodule/compiler/parseErrorIncorrectReturnToken.errors.txt index da6d517a345..915d1abde77 100644 --- a/testdata/baselines/reference/submodule/compiler/parseErrorIncorrectReturnToken.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/parseErrorIncorrectReturnToken.errors.txt @@ -1,3 +1,4 @@ +error TS-1: Pre-emit (7) and post-emit (8) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! parseErrorIncorrectReturnToken.ts(2,17): error TS1005: ':' expected. parseErrorIncorrectReturnToken.ts(4,22): error TS1005: '=>' expected. parseErrorIncorrectReturnToken.ts(4,24): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -7,6 +8,9 @@ parseErrorIncorrectReturnToken.ts(9,21): error TS2693: 'string' only refers to a parseErrorIncorrectReturnToken.ts(12,1): error TS1128: Declaration or statement expected. +!!! error TS-1: Pre-emit (7) and post-emit (8) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2304 parseErrorIncorrectReturnToken.ts:10:16: Cannot find name 'n'. ==== parseErrorIncorrectReturnToken.ts (7 errors) ==== type F1 = { (n: number) => string; // should be : not => diff --git a/testdata/baselines/reference/submodule/conformance/parser519458.errors.txt b/testdata/baselines/reference/submodule/conformance/parser519458.errors.txt index 4534e059f31..18f6e68c68b 100644 --- a/testdata/baselines/reference/submodule/conformance/parser519458.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parser519458.errors.txt @@ -1,14 +1,11 @@ parser519458.ts(1,15): error TS2503: Cannot find namespace 'module'. -parser519458.ts(1,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. parser519458.ts(1,21): error TS1005: ';' expected. -==== parser519458.ts (3 errors) ==== +==== parser519458.ts (2 errors) ==== import rect = module("rect"); var bar = new rect.Rect(); ~~~~~~ !!! error TS2503: Cannot find namespace 'module'. - ~~~~~~ -!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. ~ !!! error TS1005: ';' expected. \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserExportAssignment5.errors.txt b/testdata/baselines/reference/submodule/conformance/parserExportAssignment5.errors.txt index 84fc1904255..f496ef1167c 100644 --- a/testdata/baselines/reference/submodule/conformance/parserExportAssignment5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserExportAssignment5.errors.txt @@ -1,6 +1,10 @@ +error TS-1: Pre-emit (1) and post-emit (2) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in a namespace. +!!! error TS-1: Pre-emit (1) and post-emit (2) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2304 parserExportAssignment5.ts:2:14: Cannot find name 'A'. ==== parserExportAssignment5.ts (1 errors) ==== namespace M { export = A; diff --git a/testdata/baselines/reference/submodule/conformance/parserExportAssignment9.errors.txt b/testdata/baselines/reference/submodule/conformance/parserExportAssignment9.errors.txt index 67949c07edb..273f855a2f6 100644 --- a/testdata/baselines/reference/submodule/conformance/parserExportAssignment9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserExportAssignment9.errors.txt @@ -1,7 +1,12 @@ +error TS-1: Pre-emit (2) and post-emit (4) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! parserExportAssignment9.ts(2,3): error TS1319: A default export can only be used in an ECMAScript-style module. parserExportAssignment9.ts(6,3): error TS1319: A default export can only be used in an ECMAScript-style module. +!!! error TS-1: Pre-emit (2) and post-emit (4) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2552 parserExportAssignment9.ts:2:18: Cannot find name 'foo'. Did you mean 'Foo'? +!!! related TS2552 parserExportAssignment9.ts:6:18: Cannot find name 'bar'. Did you mean 'Bar'? ==== parserExportAssignment9.ts (2 errors) ==== namespace Foo { export default foo; diff --git a/testdata/baselines/reference/submodule/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt b/testdata/baselines/reference/submodule/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt index 5583b05fad7..f82d4967ff7 100644 --- a/testdata/baselines/reference/submodule/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt @@ -1,7 +1,11 @@ +error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! parserStatementIsNotAMemberVariableDeclaration1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. parserStatementIsNotAMemberVariableDeclaration1.ts(6,5): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. +!!! error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2304 parserStatementIsNotAMemberVariableDeclaration1.ts:6:5: Cannot find name 'private'. ==== parserStatementIsNotAMemberVariableDeclaration1.ts (2 errors) ==== return { ~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/shadowedInternalModule.errors.txt b/testdata/baselines/reference/submodule/conformance/shadowedInternalModule.errors.txt index c2c7218ecf4..e24f4d4a243 100644 --- a/testdata/baselines/reference/submodule/conformance/shadowedInternalModule.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/shadowedInternalModule.errors.txt @@ -1,3 +1,4 @@ +error TS-1: Pre-emit (5) and post-emit (6) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! shadowedInternalModule.ts(13,20): error TS2437: Module 'A' is hidden by a local declaration with the same name. shadowedInternalModule.ts(25,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. shadowedInternalModule.ts(30,5): error TS2440: Import declaration conflicts with local declaration of 'Y'. @@ -5,6 +6,9 @@ shadowedInternalModule.ts(47,10): error TS2438: Import name cannot be 'any'. shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with local declaration of 'Q'. +!!! error TS-1: Pre-emit (5) and post-emit (6) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! +!!! related TS-1: The excess diagnostics are: +!!! related TS2708 shadowedInternalModule.ts:42:21: Cannot use namespace 'a' as a value. ==== shadowedInternalModule.ts (5 errors) ==== // all errors imported modules conflict with local variables diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff similarity index 72% rename from testdata/baselines/reference/submoduleAccepted/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff rename to testdata/baselines/reference/submoduleTriaged/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff index 1b434c5b6c3..5d80403970c 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff @@ -2,9 +2,12 @@ +++ new.constructorWithIncompleteTypeAnnotation.errors.txt @@= skipped -0, +0 lines =@@ -error TS-1: Pre-emit (93) and post-emit (94) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++error TS-1: Pre-emit (92) and post-emit (93) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2503: Cannot find namespace 'module'. - constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. +-constructorWithIncompleteTypeAnnotation.ts(11,13): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. constructorWithIncompleteTypeAnnotation.ts(11,19): error TS1005: ';' expected. + constructorWithIncompleteTypeAnnotation.ts(22,35): error TS1005: ')' expected. + constructorWithIncompleteTypeAnnotation.ts(22,39): error TS2363: The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type. @@= skipped -42, +41 lines =@@ constructorWithIncompleteTypeAnnotation.ts(159,30): error TS1005: '{' expected. constructorWithIncompleteTypeAnnotation.ts(159,31): error TS2304: Cannot find name 'Property'. @@ -28,12 +31,24 @@ -!!! error TS-1: Pre-emit (93) and post-emit (94) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! --!!! related TS-1: The excess diagnostics are: --!!! related TS7017 constructorWithIncompleteTypeAnnotation.ts:239:29: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. - ==== constructorWithIncompleteTypeAnnotation.ts (93 errors) ==== ++!!! error TS-1: Pre-emit (92) and post-emit (93) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + !!! related TS-1: The excess diagnostics are: + !!! related TS7017 constructorWithIncompleteTypeAnnotation.ts:239:29: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature. +-==== constructorWithIncompleteTypeAnnotation.ts (93 errors) ==== ++==== constructorWithIncompleteTypeAnnotation.ts (92 errors) ==== declare module "fs" { export class File { -@@= skipped -138, +135 lines =@@ + constructor(filename: string); +@@= skipped -17, +17 lines =@@ + import fs = module("fs"); + ~~~~~~ + !!! error TS2503: Cannot find namespace 'module'. +- ~~~~~~ +-!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1005: ';' expected. + +@@= skipped -121, +119 lines =@@ var undef = undefined; var _\uD4A5\u7204\uC316\uE59F = local; diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff similarity index 75% rename from testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff rename to testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff index b003cd77438..f6096cfe3eb 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff @@ -2,20 +2,18 @@ +++ new.declarationEmitUnknownImport(target=es2015).errors.txt @@= skipped -0, +0 lines =@@ declarationEmitUnknownImport.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. - declarationEmitUnknownImport.ts(1,14): error TS2304: Cannot find name 'SomeNonExistingName'. +-declarationEmitUnknownImport.ts(1,14): error TS2304: Cannot find name 'SomeNonExistingName'. declarationEmitUnknownImport.ts(1,14): error TS2503: Cannot find namespace 'SomeNonExistingName'. -- -- --==== declarationEmitUnknownImport.ts (3 errors) ==== +declarationEmitUnknownImport.ts(2,9): error TS2303: Circular definition of import alias 'Foo'. -+ -+ -+==== declarationEmitUnknownImport.ts (4 errors) ==== - import Foo = SomeNonExistingName + + + ==== declarationEmitUnknownImport.ts (3 errors) ==== +@@= skipped -7, +7 lines =@@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2303: Circular definition of import alias 'Foo'. -@@= skipped -11, +12 lines =@@ ~~~~~~~~~~~~~~~~~~~ +-!!! error TS2304: Cannot find name 'SomeNonExistingName'. +- ~~~~~~~~~~~~~~~~~~~ !!! error TS2503: Cannot find namespace 'SomeNonExistingName'. export {Foo} + ~~~ diff --git a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff similarity index 51% rename from testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff rename to testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff index be0d2614443..0ae76ded2bb 100644 --- a/testdata/baselines/reference/submoduleAccepted/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff +++ b/testdata/baselines/reference/submoduleTriaged/compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff @@ -1,20 +1,22 @@ --- old.declarationEmitUnknownImport2(target=es2015).errors.txt +++ new.declarationEmitUnknownImport2(target=es2015).errors.txt -@@= skipped -2, +2 lines =@@ - declarationEmitUnknownImport2.ts(1,12): error TS2304: Cannot find name 'From'. +@@= skipped -0, +0 lines =@@ + declarationEmitUnknownImport2.ts(1,1): error TS2303: Circular definition of import alias 'Foo'. + declarationEmitUnknownImport2.ts(1,12): error TS1005: '=' expected. +-declarationEmitUnknownImport2.ts(1,12): error TS2304: Cannot find name 'From'. declarationEmitUnknownImport2.ts(1,12): error TS2503: Cannot find namespace 'From'. declarationEmitUnknownImport2.ts(1,17): error TS1005: ';' expected. -- -- --==== declarationEmitUnknownImport2.ts (5 errors) ==== +declarationEmitUnknownImport2.ts(2,1): error TS2303: Circular definition of import alias 'Foo'. -+ -+ -+==== declarationEmitUnknownImport2.ts (6 errors) ==== - import Foo From './Foo'; // Syntax error - ~~~~~~~~~~~~~~~ - !!! error TS2303: Circular definition of import alias 'Foo'. -@@= skipped -15, +16 lines =@@ + + + ==== declarationEmitUnknownImport2.ts (5 errors) ==== +@@= skipped -11, +11 lines =@@ + ~~~~ + !!! error TS1005: '=' expected. + ~~~~ +-!!! error TS2304: Cannot find name 'From'. +- ~~~~ + !!! error TS2503: Cannot find namespace 'From'. ~~~~~~~ !!! error TS1005: ';' expected. export default Foo diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithClassModifiers.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithClassModifiers.errors.txt.diff new file mode 100644 index 00000000000..ca09f91def1 --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithClassModifiers.errors.txt.diff @@ -0,0 +1,48 @@ +--- old.importDeclWithClassModifiers.errors.txt ++++ new.importDeclWithClassModifiers.errors.txt +@@= skipped -0, +0 lines =@@ ++error TS-1: Pre-emit (6) and post-emit (9) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + importDeclWithClassModifiers.ts(5,8): error TS1044: 'public' modifier cannot appear on a module or namespace element. +-importDeclWithClassModifiers.ts(5,26): error TS2708: Cannot use namespace 'x' as a value. + importDeclWithClassModifiers.ts(5,28): error TS2694: Namespace 'x' has no exported member 'c'. + importDeclWithClassModifiers.ts(6,8): error TS1044: 'private' modifier cannot appear on a module or namespace element. +-importDeclWithClassModifiers.ts(6,27): error TS2708: Cannot use namespace 'x' as a value. + importDeclWithClassModifiers.ts(6,29): error TS2694: Namespace 'x' has no exported member 'c'. + importDeclWithClassModifiers.ts(7,8): error TS1044: 'static' modifier cannot appear on a module or namespace element. +-importDeclWithClassModifiers.ts(7,26): error TS2708: Cannot use namespace 'x' as a value. + importDeclWithClassModifiers.ts(7,28): error TS2694: Namespace 'x' has no exported member 'c'. + + +-==== importDeclWithClassModifiers.ts (9 errors) ==== ++!!! error TS-1: Pre-emit (6) and post-emit (9) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2708 importDeclWithClassModifiers.ts:5:26: Cannot use namespace 'x' as a value. ++!!! related TS2708 importDeclWithClassModifiers.ts:6:27: Cannot use namespace 'x' as a value. ++!!! related TS2708 importDeclWithClassModifiers.ts:7:26: Cannot use namespace 'x' as a value. ++==== importDeclWithClassModifiers.ts (6 errors) ==== + namespace x { + interface c { + } +@@= skipped -16, +19 lines =@@ + export public import a = x.c; + ~~~~~~ + !!! error TS1044: 'public' modifier cannot appear on a module or namespace element. +- ~ +-!!! error TS2708: Cannot use namespace 'x' as a value. + ~ + !!! error TS2694: Namespace 'x' has no exported member 'c'. + export private import b = x.c; + ~~~~~~~ + !!! error TS1044: 'private' modifier cannot appear on a module or namespace element. +- ~ +-!!! error TS2708: Cannot use namespace 'x' as a value. + ~ + !!! error TS2694: Namespace 'x' has no exported member 'c'. + export static import c = x.c; + ~~~~~~ + !!! error TS1044: 'static' modifier cannot appear on a module or namespace element. +- ~ +-!!! error TS2708: Cannot use namespace 'x' as a value. + ~ + !!! error TS2694: Namespace 'x' has no exported member 'c'. + var b: a; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt.diff new file mode 100644 index 00000000000..ad9435fcecf --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/compiler/importDeclWithExportModifierAndExportAssignment.errors.txt.diff @@ -0,0 +1,24 @@ +--- old.importDeclWithExportModifierAndExportAssignment.errors.txt ++++ new.importDeclWithExportModifierAndExportAssignment.errors.txt +@@= skipped -0, +0 lines =@@ +-importDeclWithExportModifierAndExportAssignment.ts(5,19): error TS2708: Cannot use namespace 'x' as a value. ++error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + importDeclWithExportModifierAndExportAssignment.ts(5,21): error TS2694: Namespace 'x' has no exported member 'c'. + importDeclWithExportModifierAndExportAssignment.ts(6,1): error TS2309: An export assignment cannot be used in a module with other exported elements. + + +-==== importDeclWithExportModifierAndExportAssignment.ts (3 errors) ==== ++!!! error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2708 importDeclWithExportModifierAndExportAssignment.ts:5:19: Cannot use namespace 'x' as a value. ++==== importDeclWithExportModifierAndExportAssignment.ts (2 errors) ==== + namespace x { + interface c { + } + } + export import a = x.c; +- ~ +-!!! error TS2708: Cannot use namespace 'x' as a value. + ~ + !!! error TS2694: Namespace 'x' has no exported member 'c'. + export = x; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt.diff new file mode 100644 index 00000000000..0b161fa8c18 --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt.diff @@ -0,0 +1,19 @@ +--- old.internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt ++++ new.internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt +@@= skipped -0, +0 lines =@@ +- ++error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++ ++ ++!!! error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2708 internalAliasInterfaceInsideTopLevelModuleWithExport.ts:6:19: Cannot use namespace 'a' as a value. ++==== internalAliasInterfaceInsideTopLevelModuleWithExport.ts (0 errors) ==== ++ export namespace a { ++ export interface I { ++ } ++ } ++ ++ export import b = a.I; ++ export var x: b; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt.diff new file mode 100644 index 00000000000..eddc07dc3a0 --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt.diff @@ -0,0 +1,24 @@ +--- old.internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt ++++ new.internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt +@@= skipped -0, +0 lines =@@ +- ++error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++ ++ ++!!! error TS-1: Pre-emit (0) and post-emit (1) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2708 internalAliasUninitializedModuleInsideLocalModuleWithExport.ts:10:23: Cannot use namespace 'a' as a value. ++==== internalAliasUninitializedModuleInsideLocalModuleWithExport.ts (0 errors) ==== ++ export namespace a { ++ export namespace b { ++ export interface I { ++ foo(); ++ } ++ } ++ } ++ ++ export namespace c { ++ export import b = a.b; ++ export var x: b.I; ++ x.foo(); ++ } \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt.diff deleted file mode 100644 index e6480de1d98..00000000000 --- a/testdata/baselines/reference/submoduleTriaged/compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt.diff +++ /dev/null @@ -1,16 +0,0 @@ ---- old.multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt -+++ new.multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt -@@= skipped -0, +0 lines =@@ --error TS-1: Pre-emit (1) and post-emit (5) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! - multiLinePropertyAccessAndArrowFunctionIndent1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. - - --!!! error TS-1: Pre-emit (1) and post-emit (5) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! --!!! related TS-1: The excess diagnostics are: --!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:1:18: Cannot find name 'role'. --!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:2:18: Cannot find name 'Role'. --!!! related TS2503 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:26: Cannot find namespace 'ng'. --!!! related TS2304 multiLinePropertyAccessAndArrowFunctionIndent1.ts:4:53: Cannot find name 'Role'. - ==== multiLinePropertyAccessAndArrowFunctionIndent1.ts (1 errors) ==== - return this.edit(role) - ~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/compiler/parseErrorIncorrectReturnToken.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/compiler/parseErrorIncorrectReturnToken.errors.txt.diff deleted file mode 100644 index 01cb89ee4ae..00000000000 --- a/testdata/baselines/reference/submoduleTriaged/compiler/parseErrorIncorrectReturnToken.errors.txt.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- old.parseErrorIncorrectReturnToken.errors.txt -+++ new.parseErrorIncorrectReturnToken.errors.txt -@@= skipped -0, +0 lines =@@ --error TS-1: Pre-emit (7) and post-emit (8) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! - parseErrorIncorrectReturnToken.ts(2,17): error TS1005: ':' expected. - parseErrorIncorrectReturnToken.ts(4,22): error TS1005: '=>' expected. - parseErrorIncorrectReturnToken.ts(4,24): error TS2693: 'string' only refers to a type, but is being used as a value here. -@@= skipped -7, +6 lines =@@ - parseErrorIncorrectReturnToken.ts(12,1): error TS1128: Declaration or statement expected. - - --!!! error TS-1: Pre-emit (7) and post-emit (8) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! --!!! related TS-1: The excess diagnostics are: --!!! related TS2304 parseErrorIncorrectReturnToken.ts:10:16: Cannot find name 'n'. - ==== parseErrorIncorrectReturnToken.ts (7 errors) ==== - type F1 = { - (n: number) => string; // should be : not => \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/conformance/parser519458.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/conformance/parser519458.errors.txt.diff new file mode 100644 index 00000000000..1c1ae5a488e --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/conformance/parser519458.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.parser519458.errors.txt ++++ new.parser519458.errors.txt +@@= skipped -0, +0 lines =@@ + parser519458.ts(1,15): error TS2503: Cannot find namespace 'module'. +-parser519458.ts(1,15): error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + parser519458.ts(1,21): error TS1005: ';' expected. + + +-==== parser519458.ts (3 errors) ==== ++==== parser519458.ts (2 errors) ==== + import rect = module("rect"); var bar = new rect.Rect(); + ~~~~~~ + !!! error TS2503: Cannot find namespace 'module'. +- ~~~~~~ +-!!! error TS2591: Cannot find name 'module'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig. + ~ + !!! error TS1005: ';' expected. + \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment5.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment5.errors.txt.diff new file mode 100644 index 00000000000..f0bf5158e2c --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment5.errors.txt.diff @@ -0,0 +1,13 @@ +--- old.parserExportAssignment5.errors.txt ++++ new.parserExportAssignment5.errors.txt +@@= skipped -0, +0 lines =@@ ++error TS-1: Pre-emit (1) and post-emit (2) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + parserExportAssignment5.ts(2,5): error TS1063: An export assignment cannot be used in a namespace. + + ++!!! error TS-1: Pre-emit (1) and post-emit (2) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2304 parserExportAssignment5.ts:2:14: Cannot find name 'A'. + ==== parserExportAssignment5.ts (1 errors) ==== + namespace M { + export = A; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment9.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment9.errors.txt.diff new file mode 100644 index 00000000000..a5016457421 --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/conformance/parserExportAssignment9.errors.txt.diff @@ -0,0 +1,15 @@ +--- old.parserExportAssignment9.errors.txt ++++ new.parserExportAssignment9.errors.txt +@@= skipped -0, +0 lines =@@ ++error TS-1: Pre-emit (2) and post-emit (4) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + parserExportAssignment9.ts(2,3): error TS1319: A default export can only be used in an ECMAScript-style module. + parserExportAssignment9.ts(6,3): error TS1319: A default export can only be used in an ECMAScript-style module. + + ++!!! error TS-1: Pre-emit (2) and post-emit (4) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2552 parserExportAssignment9.ts:2:18: Cannot find name 'foo'. Did you mean 'Foo'? ++!!! related TS2552 parserExportAssignment9.ts:6:18: Cannot find name 'bar'. Did you mean 'Bar'? + ==== parserExportAssignment9.ts (2 errors) ==== + namespace Foo { + export default foo; \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt.diff deleted file mode 100644 index 24042864ab8..00000000000 --- a/testdata/baselines/reference/submoduleTriaged/conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- old.parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt -+++ new.parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt -@@= skipped -0, +0 lines =@@ --error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! - parserStatementIsNotAMemberVariableDeclaration1.ts(1,1): error TS1108: A 'return' statement can only be used within a function body. - parserStatementIsNotAMemberVariableDeclaration1.ts(6,5): error TS1212: Identifier expected. 'private' is a reserved word in strict mode. - - --!!! error TS-1: Pre-emit (2) and post-emit (3) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! --!!! related TS-1: The excess diagnostics are: --!!! related TS2304 parserStatementIsNotAMemberVariableDeclaration1.ts:6:5: Cannot find name 'private'. - ==== parserStatementIsNotAMemberVariableDeclaration1.ts (2 errors) ==== - return { - ~~~~~~ \ No newline at end of file diff --git a/testdata/baselines/reference/submoduleTriaged/conformance/shadowedInternalModule.errors.txt.diff b/testdata/baselines/reference/submoduleTriaged/conformance/shadowedInternalModule.errors.txt.diff new file mode 100644 index 00000000000..1f5f9fca519 --- /dev/null +++ b/testdata/baselines/reference/submoduleTriaged/conformance/shadowedInternalModule.errors.txt.diff @@ -0,0 +1,17 @@ +--- old.shadowedInternalModule.errors.txt ++++ new.shadowedInternalModule.errors.txt +@@= skipped -0, +0 lines =@@ ++error TS-1: Pre-emit (5) and post-emit (6) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! + shadowedInternalModule.ts(13,20): error TS2437: Module 'A' is hidden by a local declaration with the same name. + shadowedInternalModule.ts(25,9): error TS2564: Property 'name' has no initializer and is not definitely assigned in the constructor. + shadowedInternalModule.ts(30,5): error TS2440: Import declaration conflicts with local declaration of 'Y'. +@@= skipped -4, +5 lines =@@ + shadowedInternalModule.ts(62,3): error TS2440: Import declaration conflicts with local declaration of 'Q'. + + ++!!! error TS-1: Pre-emit (5) and post-emit (6) diagnostic counts do not match! This can indicate that a semantic _error_ was added by the emit resolver - such an error may not be reflected on the command line or in the editor, but may be captured in a baseline here! ++!!! related TS-1: The excess diagnostics are: ++!!! related TS2708 shadowedInternalModule.ts:42:21: Cannot use namespace 'a' as a value. + ==== shadowedInternalModule.ts (5 errors) ==== + // all errors imported modules conflict with local variables + \ No newline at end of file diff --git a/testdata/submoduleAccepted.txt b/testdata/submoduleAccepted.txt index f4ce0423807..76cc4ac08c2 100644 --- a/testdata/submoduleAccepted.txt +++ b/testdata/submoduleAccepted.txt @@ -451,7 +451,6 @@ compiler/classWithDuplicateIdentifier.errors.txt.diff compiler/classWithDuplicateIdentifier.symbols.diff compiler/classWithDuplicateIdentifier.types.diff compiler/commonMissingSemicolons.errors.txt.diff -compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff compiler/duplicateClassElements.errors.txt.diff compiler/duplicateClassElements.symbols.diff compiler/duplicateClassElements.types.diff @@ -654,8 +653,6 @@ compiler/recursiveExportAssignmentAndFindAliasedType3.errors.txt.diff compiler/recursiveExportAssignmentAndFindAliasedType4.errors.txt.diff compiler/recursiveExportAssignmentAndFindAliasedType5.errors.txt.diff compiler/recursiveExportAssignmentAndFindAliasedType6.errors.txt.diff -compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff -compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff conformance/circular1.errors.txt.diff conformance/circular3.errors.txt.diff diff --git a/testdata/submoduleTriaged.txt b/testdata/submoduleTriaged.txt index d79d08cf369..e054c746d53 100644 --- a/testdata/submoduleTriaged.txt +++ b/testdata/submoduleTriaged.txt @@ -34,12 +34,6 @@ compiler/declarationEmitTypeofRest.errors.txt.diff compiler/augmentExportEquals2.errors.txt.diff compiler/exportAssignmentMembersVisibleInAugmentation.errors.txt.diff -# Corsa no longer emits the TS-1 internal diagnostic about pre-emit/post-emit diagnostic count mismatches -## https://github.com/microsoft/typescript-go/issues/3508 -compiler/multiLinePropertyAccessAndArrowFunctionIndent1.errors.txt.diff -compiler/parseErrorIncorrectReturnToken.errors.txt.diff -conformance/parserStatementIsNotAMemberVariableDeclaration1(alwaysstrict=true).errors.txt.diff - # JS declaration emit adds `export import` modifier for require-style import assignments ## https://github.com/microsoft/typescript-go/issues/3542 conformance/nodeModulesAllowJsImportAssignment(module=node16).js.diff @@ -89,3 +83,16 @@ conformance/definiteAssignmentAssertionsWithObjectShortHand.js.diff # Declaration emit simplification of class extending built-in Array ## https://github.com/microsoft/typescript-go/issues/3569 + +# Extra TS-1 internal diagnostic about pre-emit/post-emit diagnostic count mismatches +conformance/parser519458.errors.txt.diff +conformance/parserExportAssignment9.errors.txt.diff +conformance/parserExportAssignment5.errors.txt.diff +conformance/shadowedInternalModule.errors.txt.diff +compiler/internalAliasInterfaceInsideTopLevelModuleWithExport.errors.txt.diff +compiler/internalAliasUninitializedModuleInsideLocalModuleWithExport.errors.txt.diff +compiler/importDeclWithExportModifierAndExportAssignment.errors.txt.diff +compiler/importDeclWithClassModifiers.errors.txt.diff +compiler/declarationEmitUnknownImport2(target=es2015).errors.txt.diff +compiler/declarationEmitUnknownImport(target=es2015).errors.txt.diff +compiler/constructorWithIncompleteTypeAnnotation.errors.txt.diff