From 371cacd866288d59d060676359a0c5a527fe1b54 Mon Sep 17 00:00:00 2001 From: han Date: Fri, 14 Nov 2025 22:48:08 +0000 Subject: [PATCH 01/22] fix (unfinished) TS6053 missing file diagnostics to match tsc (#2081) --- internal/compiler/fileloader.go | 21 ++++++++++++++- internal/compiler/program.go | 1 + internal/compiler/program_test.go | 43 +++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index e1e84650d3..e8af6cf90a 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -10,6 +10,7 @@ import ( "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" + "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/module" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -69,6 +70,7 @@ type processedFiles struct { // if file was included using source file and its output is actually part of program // this contains mapping from output to source file outputFileToProjectReferenceSource map[tspath.Path]string + fileDiagnostics []*ast.Diagnostic } type jsxRuntimeImportSpecifier struct { @@ -80,6 +82,7 @@ func processAllProgramFiles( opts ProgramOptions, singleThreaded bool, ) processedFiles { + var fileDiagnostics []*ast.Diagnostic compilerOptions := opts.Config.CompilerOptions() rootFiles := opts.Config.FileNames() supportedExtensions := tsoptions.GetSupportedExtensions(compilerOptions, nil /*extraFileExtensions*/) @@ -168,9 +171,24 @@ func processAllProgramFiles( } file := task.file path := task.path + + // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { - // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker missingFiles = append(missingFiles, task.normalizedFilePath) + + if task.includeReason != nil { + task.includeReason.diagOnce.Do(func() { + var parentFile *ast.SourceFile + d := ast.NewDiagnostic( + parentFile, // !!! unknown parent file + core.UndefinedTextRange(), // !!! unknown location + diagnostics.File_0_not_found, + task.normalizedFilePath, + ) + task.includeReason.diag = d + fileDiagnostics = append(fileDiagnostics, d) + }) + } return } @@ -250,6 +268,7 @@ func processAllProgramFiles( missingFiles: missingFiles, includeProcessor: loader.includeProcessor, outputFileToProjectReferenceSource: outputFileToProjectReferenceSource, + fileDiagnostics: fileDiagnostics, } } diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 2dbe96c47e..2d4ea6b270 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -210,6 +210,7 @@ func NewProgram(opts ProgramOptions) *Program { p := &Program{opts: opts} p.initCheckerPool() p.processedFiles = processAllProgramFiles(p.opts, p.SingleThreaded()) + p.programDiagnostics = append(p.programDiagnostics, p.processedFiles.fileDiagnostics...) p.verifyCompilerOptions() return p } diff --git a/internal/compiler/program_test.go b/internal/compiler/program_test.go index ae3a967b30..75817e0475 100644 --- a/internal/compiler/program_test.go +++ b/internal/compiler/program_test.go @@ -312,3 +312,46 @@ func BenchmarkNewProgram(b *testing.B) { } }) } + +func TestMissingReferenceFile(t *testing.T) { + t.Parallel() + + if !bundled.Embedded { + t.Skip("bundled files are not embedded") + } + + fs := vfstest.FromMap[any](nil, false /*useCaseSensitiveFileNames*/) + fs = bundled.WrapFS(fs) + + // Write a test file that references a missing file + _ = fs.WriteFile("c:/dev/src/index.ts", `/// + const x = 42; + console.log(x);`, false) + + compilerHost := compiler.NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil, nil) + + opts := core.CompilerOptions{Target: core.ScriptTargetESNext} + + parsedConfig := &tsoptions.ParsedCommandLine{ + ParsedConfig: &core.ParsedOptions{ + FileNames: []string{"c:/dev/src/index.ts"}, + CompilerOptions: &opts, + }, + } + + program := compiler.NewProgram(compiler.ProgramOptions{ + Config: parsedConfig, + Host: compilerHost, + }) + + diagnostics := program.GetProgramDiagnostics() + found := false + for _, d := range diagnostics { + if d.Code() == 6053 { + found = true + break + } + } + + assert.Assert(t, found, "Expected TS6053 diagnostic for missing reference file") +} From 67db554b89f452ab9f06f39bae52c0e0856987f5 Mon Sep 17 00:00:00 2001 From: TranNhatHan <91483520+TranNhatHan@users.noreply.github.com> Date: Sat, 15 Nov 2025 00:15:46 +0000 Subject: [PATCH 02/22] Delete TestMissingReferenceFile test case Removed TestMissingReferenceFile due to changes in test structure. --- internal/compiler/program_test.go | 43 ------------------------------- 1 file changed, 43 deletions(-) diff --git a/internal/compiler/program_test.go b/internal/compiler/program_test.go index 75817e0475..ae3a967b30 100644 --- a/internal/compiler/program_test.go +++ b/internal/compiler/program_test.go @@ -312,46 +312,3 @@ func BenchmarkNewProgram(b *testing.B) { } }) } - -func TestMissingReferenceFile(t *testing.T) { - t.Parallel() - - if !bundled.Embedded { - t.Skip("bundled files are not embedded") - } - - fs := vfstest.FromMap[any](nil, false /*useCaseSensitiveFileNames*/) - fs = bundled.WrapFS(fs) - - // Write a test file that references a missing file - _ = fs.WriteFile("c:/dev/src/index.ts", `/// - const x = 42; - console.log(x);`, false) - - compilerHost := compiler.NewCompilerHost("c:/dev/src", fs, bundled.LibPath(), nil, nil) - - opts := core.CompilerOptions{Target: core.ScriptTargetESNext} - - parsedConfig := &tsoptions.ParsedCommandLine{ - ParsedConfig: &core.ParsedOptions{ - FileNames: []string{"c:/dev/src/index.ts"}, - CompilerOptions: &opts, - }, - } - - program := compiler.NewProgram(compiler.ProgramOptions{ - Config: parsedConfig, - Host: compilerHost, - }) - - diagnostics := program.GetProgramDiagnostics() - found := false - for _, d := range diagnostics { - if d.Code() == 6053 { - found = true - break - } - } - - assert.Assert(t, found, "Expected TS6053 diagnostic for missing reference file") -} From 5b87cc2da8636ccb9f14f26fda5e105b75bc6953 Mon Sep 17 00:00:00 2001 From: han Date: Sat, 15 Nov 2025 20:53:59 +0000 Subject: [PATCH 03/22] completely fix the missing error file not found bug --- internal/compiler/fileloader.go | 32 ++++++--------- internal/compiler/program.go | 69 ++++++++++++++++++++++++++++++++- 2 files changed, 78 insertions(+), 23 deletions(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index e8af6cf90a..62e696315a 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -10,7 +10,6 @@ import ( "github.com/microsoft/typescript-go/internal/ast" "github.com/microsoft/typescript-go/internal/collections" "github.com/microsoft/typescript-go/internal/core" - "github.com/microsoft/typescript-go/internal/diagnostics" "github.com/microsoft/typescript-go/internal/module" "github.com/microsoft/typescript-go/internal/tsoptions" "github.com/microsoft/typescript-go/internal/tspath" @@ -52,12 +51,17 @@ type fileLoader struct { pathForLibFileResolutions collections.SyncMap[tspath.Path, *libResolution] } +type missingFile struct { + path string + reason *FileIncludeReason +} + type processedFiles struct { resolver *module.Resolver files []*ast.SourceFile filesByPath map[tspath.Path]*ast.SourceFile projectReferenceFileMapper *projectReferenceFileMapper - missingFiles []string + missingFiles []missingFile resolvedModules map[tspath.Path]module.ModeAwareCache[*module.ResolvedModule] typeResolutionsInFile map[tspath.Path]module.ModeAwareCache[*module.ResolvedTypeReferenceDirective] sourceFileMetaDatas map[tspath.Path]ast.SourceFileMetaData @@ -70,7 +74,6 @@ type processedFiles struct { // if file was included using source file and its output is actually part of program // this contains mapping from output to source file outputFileToProjectReferenceSource map[tspath.Path]string - fileDiagnostics []*ast.Diagnostic } type jsxRuntimeImportSpecifier struct { @@ -82,7 +85,6 @@ func processAllProgramFiles( opts ProgramOptions, singleThreaded bool, ) processedFiles { - var fileDiagnostics []*ast.Diagnostic compilerOptions := opts.Config.CompilerOptions() rootFiles := opts.Config.FileNames() supportedExtensions := tsoptions.GetSupportedExtensions(compilerOptions, nil /*extraFileExtensions*/) @@ -139,7 +141,7 @@ func processAllProgramFiles( totalFileCount := int(loader.totalFileCount.Load()) libFileCount := int(loader.libFileCount.Load()) - var missingFiles []string + var missingFiles []missingFile files := make([]*ast.SourceFile, 0, totalFileCount-libFileCount) libFiles := make([]*ast.SourceFile, 0, totalFileCount) // totalFileCount here since we append files to it later to construct the final list @@ -174,21 +176,10 @@ func processAllProgramFiles( // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { - missingFiles = append(missingFiles, task.normalizedFilePath) - - if task.includeReason != nil { - task.includeReason.diagOnce.Do(func() { - var parentFile *ast.SourceFile - d := ast.NewDiagnostic( - parentFile, // !!! unknown parent file - core.UndefinedTextRange(), // !!! unknown location - diagnostics.File_0_not_found, - task.normalizedFilePath, - ) - task.includeReason.diag = d - fileDiagnostics = append(fileDiagnostics, d) - }) - } + missingFiles = append(missingFiles, missingFile{ + path: task.normalizedFilePath, + reason: task.includeReason, + }) return } @@ -268,7 +259,6 @@ func processAllProgramFiles( missingFiles: missingFiles, includeProcessor: loader.includeProcessor, outputFileToProjectReferenceSource: outputFileToProjectReferenceSource, - fileDiagnostics: fileDiagnostics, } } diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 2d4ea6b270..ef60b4ac28 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -210,7 +210,7 @@ func NewProgram(opts ProgramOptions) *Program { p := &Program{opts: opts} p.initCheckerPool() p.processedFiles = processAllProgramFiles(p.opts, p.SingleThreaded()) - p.programDiagnostics = append(p.programDiagnostics, p.processedFiles.fileDiagnostics...) + p.addProgramDiagnostics() p.verifyCompilerOptions() return p } @@ -1223,6 +1223,59 @@ func (p *Program) getDiagnosticsHelper(ctx context.Context, sourceFile *ast.Sour return SortAndDeduplicateDiagnostics(result) } +func (p *Program) addProgramDiagnostic(diagnostic *ast.Diagnostic) { + p.programDiagnostics = append(p.programDiagnostics, diagnostic) +} + +func (p *Program) addProgramDiagnostics() { + for _, m := range p.missingFiles { + reason := m.reason + data, ok := reason.data.(*referencedFileData) + if !ok { + // fallback if no reference info + diag := ast.NewDiagnostic( + nil, + core.UndefinedTextRange(), + diagnostics.File_0_not_found, + m.path, + ) + p.addProgramDiagnostic(diag) + continue + } + + parent := p.filesByPath[data.file] + if parent == nil { + diag := ast.NewDiagnostic( + nil, + core.UndefinedTextRange(), + diagnostics.File_0_not_found, + m.path, + ) + p.addProgramDiagnostic(diag) + continue + } + + var ref *ast.FileReference + if data.index < len(parent.ReferencedFiles) { + ref = parent.ReferencedFiles[data.index] + } + + loc := core.UndefinedTextRange() + if ref != nil { + loc = ref.TextRange + } + + diag := ast.NewDiagnostic( + parent, + loc, + diagnostics.File_0_not_found, + m.path, + ) + + p.addProgramDiagnostic(diag) + } +} + func (p *Program) LineCount() int { var count int for _, file := range p.files { @@ -1554,11 +1607,23 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { - return slices.ContainsFunc(p.missingFiles, func(missingPath string) bool { + return slices.ContainsFunc(p.missingFilePaths(), func(missingPath string) bool { return p.toPath(missingPath) == path }) } +func (p *Program) missingFilePaths() []string { + if len(p.missingFiles) == 0 { + return nil + } + + paths := make([]string, 0, len(p.missingFiles)) + for _, m := range p.missingFiles { + paths = append(paths, m.path) + } + return paths +} + func (p *Program) ExplainFiles(w io.Writer) { toRelativeFileName := func(fileName string) string { return tspath.GetRelativePathFromDirectory(p.GetCurrentDirectory(), fileName, p.comparePathsOptions) From 0b3f881380447425bd9970df043250476116f97b Mon Sep 17 00:00:00 2001 From: han Date: Sun, 16 Nov 2025 12:37:14 +0000 Subject: [PATCH 04/22] failed incremental test in scenario "when global file is added, the signatures are updated" --- internal/compiler/program.go | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index ef60b4ac28..ac3e3e79f7 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1232,42 +1232,26 @@ func (p *Program) addProgramDiagnostics() { reason := m.reason data, ok := reason.data.(*referencedFileData) if !ok { - // fallback if no reference info - diag := ast.NewDiagnostic( - nil, - core.UndefinedTextRange(), - diagnostics.File_0_not_found, - m.path, - ) - p.addProgramDiagnostic(diag) continue } parent := p.filesByPath[data.file] if parent == nil { - diag := ast.NewDiagnostic( - nil, - core.UndefinedTextRange(), - diagnostics.File_0_not_found, - m.path, - ) - p.addProgramDiagnostic(diag) continue } var ref *ast.FileReference + if data.index < len(parent.ReferencedFiles) { ref = parent.ReferencedFiles[data.index] } - - loc := core.UndefinedTextRange() - if ref != nil { - loc = ref.TextRange + if ref == nil { + continue } diag := ast.NewDiagnostic( parent, - loc, + ref.TextRange, diagnostics.File_0_not_found, m.path, ) From b44a24786f61bbd0ad213d6efbe4f9fbd84cf295 Mon Sep 17 00:00:00 2001 From: han Date: Sun, 16 Nov 2025 15:21:41 +0000 Subject: [PATCH 05/22] fix: attach missing-file diagnostics to the correct source file --- internal/compiler/program.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index ac3e3e79f7..c9358676d3 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1242,9 +1242,13 @@ func (p *Program) addProgramDiagnostics() { var ref *ast.FileReference - if data.index < len(parent.ReferencedFiles) { - ref = parent.ReferencedFiles[data.index] + for _, r := range parent.ReferencedFiles { + if r.FileName == string(m.path) { + ref = r + break + } } + if ref == nil { continue } From b6151253c8fe1a54c13cedc571ac71b3a2b92b6e Mon Sep 17 00:00:00 2001 From: han Date: Sun, 16 Nov 2025 17:49:10 +0000 Subject: [PATCH 06/22] fix: resolve golangci-lint errors --- internal/compiler/program.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index c9358676d3..dd81c556a8 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1243,7 +1243,7 @@ func (p *Program) addProgramDiagnostics() { var ref *ast.FileReference for _, r := range parent.ReferencedFiles { - if r.FileName == string(m.path) { + if r.FileName == m.path { ref = r break } From ad5011301fa113ec5cc635275757b4f6567ca4fe Mon Sep 17 00:00:00 2001 From: han Date: Mon, 17 Nov 2025 23:52:56 +0000 Subject: [PATCH 07/22] update code per maintainer suggestions --- .golangci.yml | 9 ++++----- internal/compiler/program.go | 36 +++++++----------------------------- 2 files changed, 11 insertions(+), 34 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 469b2bbbb1..8d0d6236a3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,7 +14,7 @@ linters: - bodyclose - canonicalheader - copyloopvar - - customlint + # - customlint - depguard - durationcheck - errcheck @@ -61,10 +61,9 @@ linters: # - unused settings: - custom: - customlint: - type: module - + # custom: + # customlint: + # type: module depguard: rules: main: diff --git a/internal/compiler/program.go b/internal/compiler/program.go index dd81c556a8..d0bccfe7e5 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1223,10 +1223,6 @@ func (p *Program) getDiagnosticsHelper(ctx context.Context, sourceFile *ast.Sour return SortAndDeduplicateDiagnostics(result) } -func (p *Program) addProgramDiagnostic(diagnostic *ast.Diagnostic) { - p.programDiagnostics = append(p.programDiagnostics, diagnostic) -} - func (p *Program) addProgramDiagnostics() { for _, m := range p.missingFiles { reason := m.reason @@ -1240,27 +1236,21 @@ func (p *Program) addProgramDiagnostics() { continue } - var ref *ast.FileReference - - for _, r := range parent.ReferencedFiles { - if r.FileName == m.path { - ref = r - break - } - } - + ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { + return r.FileName == m.path + }) if ref == nil { continue } - diag := ast.NewDiagnostic( + diagnostic := ast.NewDiagnostic( parent, ref.TextRange, diagnostics.File_0_not_found, m.path, ) - p.addProgramDiagnostic(diag) + p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } @@ -1595,23 +1585,11 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { - return slices.ContainsFunc(p.missingFilePaths(), func(missingPath string) bool { - return p.toPath(missingPath) == path + return slices.ContainsFunc(p.missingFiles, func(missingPath missingFile) bool { + return p.toPath(missingPath.path) == path }) } -func (p *Program) missingFilePaths() []string { - if len(p.missingFiles) == 0 { - return nil - } - - paths := make([]string, 0, len(p.missingFiles)) - for _, m := range p.missingFiles { - paths = append(paths, m.path) - } - return paths -} - func (p *Program) ExplainFiles(w io.Writer) { toRelativeFileName := func(fileName string) string { return tspath.GetRelativePathFromDirectory(p.GetCurrentDirectory(), fileName, p.comparePathsOptions) From 0ed34891ce5c63a3a6f204d3b8d7de6d0471c770 Mon Sep 17 00:00:00 2001 From: han Date: Mon, 17 Nov 2025 23:59:55 +0000 Subject: [PATCH 08/22] reset the .golangci.yml as default --- .golangci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 8d0d6236a3..85dadbbb71 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,7 +14,7 @@ linters: - bodyclose - canonicalheader - copyloopvar - # - customlint + - customlint - depguard - durationcheck - errcheck @@ -61,9 +61,9 @@ linters: # - unused settings: - # custom: - # customlint: - # type: module + custom: + customlint: + type: module depguard: rules: main: From f46ccc9c569c7cffccdfcc2bf949d82bf4abd296 Mon Sep 17 00:00:00 2001 From: han Date: Tue, 18 Nov 2025 00:01:11 +0000 Subject: [PATCH 09/22] reset the .golangci.yml as default --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index 85dadbbb71..469b2bbbb1 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -64,6 +64,7 @@ linters: custom: customlint: type: module + depguard: rules: main: From 87bd8d6cf1beea94535eed51186c87d121b4adf3 Mon Sep 17 00:00:00 2001 From: han Date: Wed, 19 Nov 2025 15:52:17 +0000 Subject: [PATCH 10/22] accept new baseline --- ...ationEmitInvalidReference2.errors.txt.diff | 12 - ...nvalidTripleSlashReference.errors.txt.diff | 18 -- .../parserRealSource1.errors.txt.diff | 164 ---------- .../parserRealSource10.errors.txt.diff | 22 -- .../parserRealSource14.errors.txt.diff | 22 -- .../parserRealSource2.errors.txt.diff | 281 ------------------ .../parserRealSource3.errors.txt.diff | 129 -------- .../parserRealSource4.errors.txt.diff | 18 -- .../parserRealSource5.errors.txt.diff | 22 -- .../conformance/scannertest1.errors.txt.diff | 19 -- 10 files changed, 707 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff deleted file mode 100644 index ba50881c9f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.declarationEmitInvalidReference2.errors.txt -+++ new.declarationEmitInvalidReference2.errors.txt -@@= skipped -0, +0 lines =@@ --declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. -- -- --==== declarationEmitInvalidReference2.ts (1 errors) ==== -- /// -- ~~~~~~~~~~ --!!! error TS6053: File 'invalid.ts' not found. -- var x = 0; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff deleted file mode 100644 index dda05feefc..0000000000 --- a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.invalidTripleSlashReference.errors.txt -+++ new.invalidTripleSlashReference.errors.txt -@@= skipped -0, +0 lines =@@ --invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. --invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. -- -- --==== invalidTripleSlashReference.ts (2 errors) ==== -- /// -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS6053: File 'filedoesnotexist.ts' not found. -- /// -- ~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. -- -- // this test doesn't actually give the errors you want due to the way the compiler reports errors -- var x = 1; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff deleted file mode 100644 index e4a0e97966..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff +++ /dev/null @@ -1,164 +0,0 @@ ---- old.parserRealSource1.errors.txt -+++ new.parserRealSource1.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource1.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- export module CompilerDiagnostics { -- export var debug = false; -- export interface IDiagnosticWriter { -- Alert(output: string): void; -- } -- -- export var diagnosticWriter: IDiagnosticWriter = null; -- -- export var analysisPass: number = 0; -- -- export function Alert(output: string) { -- if (diagnosticWriter) { -- diagnosticWriter.Alert(output); -- } -- } -- -- export function debugPrint(s: string) { -- if (debug) { -- Alert(s); -- } -- } -- -- export function assert(condition: boolean, s: string) { -- if (debug) { -- if (!condition) { -- Alert(s); -- } -- } -- } -- -- } -- -- export interface ILogger { -- information(): boolean; -- debug(): boolean; -- warning(): boolean; -- error(): boolean; -- fatal(): boolean; -- log(s: string): void; -- } -- -- export class NullLogger implements ILogger { -- public information(): boolean { return false; } -- public debug(): boolean { return false; } -- public warning(): boolean { return false; } -- public error(): boolean { return false; } -- public fatal(): boolean { return false; } -- public log(s: string): void { -- } -- } -- -- export class LoggerAdapter implements ILogger { -- private _information: boolean; -- private _debug: boolean; -- private _warning: boolean; -- private _error: boolean; -- private _fatal: boolean; -- -- constructor (public logger: ILogger) { -- this._information = this.logger.information(); -- this._debug = this.logger.debug(); -- this._warning = this.logger.warning(); -- this._error = this.logger.error(); -- this._fatal = this.logger.fatal(); -- } -- -- -- public information(): boolean { return this._information; } -- public debug(): boolean { return this._debug; } -- public warning(): boolean { return this._warning; } -- public error(): boolean { return this._error; } -- public fatal(): boolean { return this._fatal; } -- public log(s: string): void { -- this.logger.log(s); -- } -- } -- -- export class BufferedLogger implements ILogger { -- public logContents = []; -- -- public information(): boolean { return false; } -- public debug(): boolean { return false; } -- public warning(): boolean { return false; } -- public error(): boolean { return false; } -- public fatal(): boolean { return false; } -- public log(s: string): void { -- this.logContents.push(s); -- } -- } -- -- export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { -- var start = +new Date(); -- var result = func(); -- var end = +new Date(); -- logger.log(funcDescription + " completed in " + (end - start) + " msec"); -- return result; -- } -- -- export function stringToLiteral(value: string, length: number): string { -- var result = ""; -- -- var addChar = (index: number) => { -- var ch = value.charCodeAt(index); -- switch (ch) { -- case 0x09: // tab -- result += "\\t"; -- break; -- case 0x0a: // line feed -- result += "\\n"; -- break; -- case 0x0b: // vertical tab -- result += "\\v"; -- break; -- case 0x0c: // form feed -- result += "\\f"; -- break; -- case 0x0d: // carriage return -- result += "\\r"; -- break; -- case 0x22: // double quote -- result += "\\\""; -- break; -- case 0x27: // single quote -- result += "\\\'"; -- break; -- case 0x5c: // Backslash -- result += "\\"; -- break; -- default: -- result += value.charAt(index); -- } -- } -- -- var tooLong = (value.length > length); -- if (tooLong) { -- var mid = length >> 1; -- for (var i = 0; i < mid; i++) addChar(i); -- result += "(...)"; -- for (var i = value.length - mid; i < value.length; i++) addChar(i); -- } -- else { -- length = value.length; -- for (var i = 0; i < length; i++) addChar(i); -- } -- return result; -- } -- } -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff deleted file mode 100644 index 302ee058f5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource10.errors.txt -+++ new.parserRealSource10.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. - parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. - parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. -@@= skipped -342, +341 lines =@@ - parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. - - --==== parserRealSource10.ts (343 errors) ==== -+==== parserRealSource10.ts (342 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export enum TokenID { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff deleted file mode 100644 index 112eb0b83a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource14.errors.txt -+++ new.parserRealSource14.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. - parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. - parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. -@@= skipped -159, +158 lines =@@ - parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. - - --==== parserRealSource14.ts (160 errors) ==== -+==== parserRealSource14.ts (159 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export function lastOf(items: any[]): any { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff deleted file mode 100644 index 1474c69126..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff +++ /dev/null @@ -1,281 +0,0 @@ ---- old.parserRealSource2.errors.txt -+++ new.parserRealSource2.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource2.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- -- export function hasFlag(val: number, flag: number) { -- return (val & flag) != 0; -- } -- -- export enum ErrorRecoverySet { -- None = 0, -- Comma = 1, // Comma -- SColon = 1 << 1, // SColon -- Asg = 1 << 2, // Asg -- BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv -- // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, -- // Pct, GT, LT, And, Xor, Or -- RBrack = 1 << 4, // RBrack -- RCurly = 1 << 5, // RCurly -- RParen = 1 << 6, // RParen -- Dot = 1 << 7, // Dot -- Colon = 1 << 8, // Colon -- PrimType = 1 << 9, // number, string, boolean -- AddOp = 1 << 10, // Add, Sub -- LCurly = 1 << 11, // LCurly -- PreOp = 1 << 12, // Tilde, Bang, Inc, Dec -- RegExp = 1 << 13, // RegExp -- LParen = 1 << 14, // LParen -- LBrack = 1 << 15, // LBrack -- Scope = 1 << 16, // Scope -- In = 1 << 17, // IN -- SCase = 1 << 18, // CASE, DEFAULT -- Else = 1 << 19, // ELSE -- Catch = 1 << 20, // CATCH, FINALLY -- Var = 1 << 21, // -- Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH -- While = 1 << 23, // WHILE -- ID = 1 << 24, // ID -- Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT -- Literal = 1 << 26, // IntCon, FltCon, StrCon -- RLit = 1 << 27, // THIS, TRUE, FALSE, NULL -- Func = 1 << 28, // FUNCTION -- EOF = 1 << 29, // EOF -- -- // REVIEW: Name this something clearer. -- TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT -- ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, -- StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, -- Postfix = Dot | LParen | LBrack, -- } -- -- export enum AllowedElements { -- None = 0, -- ModuleDeclarations = 1 << 2, -- ClassDeclarations = 1 << 3, -- InterfaceDeclarations = 1 << 4, -- AmbientDeclarations = 1 << 10, -- Properties = 1 << 11, -- -- Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, -- QuickParse = Global | Properties, -- } -- -- export enum Modifiers { -- None = 0, -- Private = 1, -- Public = 1 << 1, -- Readonly = 1 << 2, -- Ambient = 1 << 3, -- Exported = 1 << 4, -- Getter = 1 << 5, -- Setter = 1 << 6, -- Static = 1 << 7, -- } -- -- export enum ASTFlags { -- None = 0, -- ExplicitSemicolon = 1, // statment terminated by an explicit semicolon -- AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon -- Writeable = 1 << 2, // node is lhs that can be modified -- Error = 1 << 3, // node has an error -- DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor -- DotLHS = 1 << 5, // node is the lhs of a dot expr -- IsStatement = 1 << 6, // node is a statement -- StrictMode = 1 << 7, // node is in the strict mode environment -- PossibleOptionalParameter = 1 << 8, -- ClassBaseConstructorCall = 1 << 9, -- OptionalName = 1 << 10, -- // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. -- // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. -- // Once we have a better way to associate information with nodes, this flag should not be used. -- SkipNextRParen = 1 << 11, -- } -- -- export enum DeclFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- } -- -- export enum ModuleFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- IsEnum = 1 << 8, -- ShouldEmitModuleDecl = 1 << 9, -- IsWholeFile = 1 << 10, -- IsDynamic = 1 << 11, -- MustCaptureThis = 1 << 12, -- } -- -- export enum SymbolFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- Property = 1 << 8, -- Readonly = 1 << 9, -- ModuleMember = 1 << 10, -- InterfaceMember = 1 << 11, -- ClassMember = 1 << 12, -- BuiltIn = 1 << 13, -- TypeSetDuringScopeAssignment = 1 << 14, -- Constant = 1 << 15, -- Optional = 1 << 16, -- RecursivelyReferenced = 1 << 17, -- Bound = 1 << 18, -- CompilerGenerated = 1 << 19, -- } -- -- export enum VarFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- AutoInit = 1 << 8, -- Property = 1 << 9, -- Readonly = 1 << 10, -- Class = 1 << 11, -- ClassProperty = 1 << 12, -- ClassBodyProperty = 1 << 13, -- ClassConstructorProperty = 1 << 14, -- ClassSuperMustBeFirstCallInConstructor = 1 << 15, -- Constant = 1 << 16, -- MustCaptureThis = 1 << 17, -- } -- -- export enum FncFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- Definition = 1 << 8, -- Signature = 1 << 9, -- Method = 1 << 10, -- HasReturnExpression = 1 << 11, -- CallMember = 1 << 12, -- ConstructMember = 1 << 13, -- HasSelfReference = 1 << 14, -- IsFatArrowFunction = 1 << 15, -- IndexerMember = 1 << 16, -- IsFunctionExpression = 1 << 17, -- ClassMethod = 1 << 18, -- ClassPropertyMethodExported = 1 << 19, -- } -- -- export enum SignatureFlags { -- None = 0, -- IsIndexer = 1, -- IsStringIndexer = 1 << 1, -- IsNumberIndexer = 1 << 2, -- } -- -- export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; -- export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; -- export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; -- export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; -- export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { -- return fncOrVarOrSymbolOrModuleFlags; -- } -- -- export enum TypeFlags { -- None = 0, -- HasImplementation = 1, -- HasSelfReference = 1 << 1, -- MergeResult = 1 << 2, -- IsEnum = 1 << 3, -- BuildingName = 1 << 4, -- HasBaseType = 1 << 5, -- HasBaseTypeOfObject = 1 << 6, -- IsClass = 1 << 7, -- } -- -- export enum TypeRelationshipFlags { -- SuccessfulComparison = 0, -- SourceIsNullTargetIsVoidOrUndefined = 1, -- RequiredPropertyIsMissing = 1 << 1, -- IncompatibleSignatures = 1 << 2, -- SourceSignatureHasTooManyParameters = 3, -- IncompatibleReturnTypes = 1 << 4, -- IncompatiblePropertyTypes = 1 << 5, -- IncompatibleParameterTypes = 1 << 6, -- } -- -- export enum CodeGenTarget { -- ES3 = 0, -- ES5 = 1, -- } -- -- export enum ModuleGenTarget { -- Synchronous = 0, -- Asynchronous = 1, -- Local = 1 << 1, -- } -- -- // Compiler defaults to generating ES5-compliant code for -- // - getters and setters -- export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; -- -- export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; -- -- export var optimizeModuleCodeGen = true; -- -- export function flagsToString(e, flags: number): string { -- var builder = ""; -- for (var i = 1; i < (1 << 31) ; i = i << 1) { -- if ((flags & i) != 0) { -- for (var k in e) { -- if (e[k] == i) { -- if (builder.length > 0) { -- builder += "|"; -- } -- builder += k; -- break; -- } -- } -- } -- } -- return builder; -- } -- -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff deleted file mode 100644 index abd13c93f3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff +++ /dev/null @@ -1,129 +0,0 @@ ---- old.parserRealSource3.errors.txt -+++ new.parserRealSource3.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource3.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback -- export enum NodeType { -- None, -- Empty, -- EmptyExpr, -- True, -- False, -- This, -- Super, -- QString, -- Regex, -- Null, -- ArrayLit, -- ObjectLit, -- Void, -- Comma, -- Pos, -- Neg, -- Delete, -- Await, -- In, -- Dot, -- From, -- Is, -- InstOf, -- Typeof, -- NumberLit, -- Name, -- TypeRef, -- Index, -- Call, -- New, -- Asg, -- AsgAdd, -- AsgSub, -- AsgDiv, -- AsgMul, -- AsgMod, -- AsgAnd, -- AsgXor, -- AsgOr, -- AsgLsh, -- AsgRsh, -- AsgRs2, -- ConditionalExpression, -- LogOr, -- LogAnd, -- Or, -- Xor, -- And, -- Eq, -- Ne, -- Eqv, -- NEqv, -- Lt, -- Le, -- Gt, -- Ge, -- Add, -- Sub, -- Mul, -- Div, -- Mod, -- Lsh, -- Rsh, -- Rs2, -- Not, -- LogNot, -- IncPre, -- DecPre, -- IncPost, -- DecPost, -- TypeAssertion, -- FuncDecl, -- Member, -- VarDecl, -- ArgDecl, -- Return, -- Break, -- Continue, -- Throw, -- For, -- ForIn, -- If, -- While, -- DoWhile, -- Block, -- Case, -- Switch, -- Try, -- TryCatch, -- TryFinally, -- Finally, -- Catch, -- List, -- Script, -- ClassDeclaration, -- InterfaceDeclaration, -- ModuleDeclaration, -- ImportDeclaration, -- With, -- Label, -- LabeledStatement, -- EBStart, -- GotoEB, -- EndCode, -- Error, -- Comment, -- Debugger, -- GeneralNode = FuncDecl, -- LastAsg = AsgRs2, -- } -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff deleted file mode 100644 index a20c55edde..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.parserRealSource4.errors.txt -+++ new.parserRealSource4.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. - - --==== parserRealSource4.ts (2 errors) ==== -+==== parserRealSource4.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff deleted file mode 100644 index 5c7ec99caf..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource5.errors.txt -+++ new.parserRealSource5.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. - parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. - parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. -@@= skipped -8, +7 lines =@@ - parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. - - --==== parserRealSource5.ts (9 errors) ==== -+==== parserRealSource5.ts (8 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - // TODO: refactor indent logic for use in emit \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff deleted file mode 100644 index 2d8965d4df..0000000000 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.scannertest1.errors.txt -+++ new.scannertest1.errors.txt -@@= skipped -0, +0 lines =@@ --scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. - scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. - scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. - scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? -@@= skipped -15, +14 lines =@@ - scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. - - --==== scannertest1.ts (16 errors) ==== -+==== scannertest1.ts (15 errors) ==== - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'References.ts' not found. - - class CharacterInfo { - public static isDecimalDigit(c: number): boolean { \ No newline at end of file From aad5fc2232a89d16394967061b919d8e3394caa0 Mon Sep 17 00:00:00 2001 From: han Date: Wed, 19 Nov 2025 16:49:24 +0000 Subject: [PATCH 11/22] Revert "accept new baseline" This reverts commit 87bd8d6cf1beea94535eed51186c87d121b4adf3. --- ...ationEmitInvalidReference2.errors.txt.diff | 12 + ...nvalidTripleSlashReference.errors.txt.diff | 18 ++ .../parserRealSource1.errors.txt.diff | 164 ++++++++++ .../parserRealSource10.errors.txt.diff | 22 ++ .../parserRealSource14.errors.txt.diff | 22 ++ .../parserRealSource2.errors.txt.diff | 281 ++++++++++++++++++ .../parserRealSource3.errors.txt.diff | 129 ++++++++ .../parserRealSource4.errors.txt.diff | 18 ++ .../parserRealSource5.errors.txt.diff | 22 ++ .../conformance/scannertest1.errors.txt.diff | 19 ++ 10 files changed, 707 insertions(+) create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff new file mode 100644 index 0000000000..ba50881c9f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff @@ -0,0 +1,12 @@ +--- old.declarationEmitInvalidReference2.errors.txt ++++ new.declarationEmitInvalidReference2.errors.txt +@@= skipped -0, +0 lines =@@ +-declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. +- +- +-==== declarationEmitInvalidReference2.ts (1 errors) ==== +- /// +- ~~~~~~~~~~ +-!!! error TS6053: File 'invalid.ts' not found. +- var x = 0; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff new file mode 100644 index 0000000000..dda05feefc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.invalidTripleSlashReference.errors.txt ++++ new.invalidTripleSlashReference.errors.txt +@@= skipped -0, +0 lines =@@ +-invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. +-invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. +- +- +-==== invalidTripleSlashReference.ts (2 errors) ==== +- /// +- ~~~~~~~~~~~~~~~~~~~ +-!!! error TS6053: File 'filedoesnotexist.ts' not found. +- /// +- ~~~~~~~~~~~~~~~~~~~~~~ +-!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. +- +- // this test doesn't actually give the errors you want due to the way the compiler reports errors +- var x = 1; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff new file mode 100644 index 0000000000..e4a0e97966 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff @@ -0,0 +1,164 @@ +--- old.parserRealSource1.errors.txt ++++ new.parserRealSource1.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource1.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- export module CompilerDiagnostics { +- export var debug = false; +- export interface IDiagnosticWriter { +- Alert(output: string): void; +- } +- +- export var diagnosticWriter: IDiagnosticWriter = null; +- +- export var analysisPass: number = 0; +- +- export function Alert(output: string) { +- if (diagnosticWriter) { +- diagnosticWriter.Alert(output); +- } +- } +- +- export function debugPrint(s: string) { +- if (debug) { +- Alert(s); +- } +- } +- +- export function assert(condition: boolean, s: string) { +- if (debug) { +- if (!condition) { +- Alert(s); +- } +- } +- } +- +- } +- +- export interface ILogger { +- information(): boolean; +- debug(): boolean; +- warning(): boolean; +- error(): boolean; +- fatal(): boolean; +- log(s: string): void; +- } +- +- export class NullLogger implements ILogger { +- public information(): boolean { return false; } +- public debug(): boolean { return false; } +- public warning(): boolean { return false; } +- public error(): boolean { return false; } +- public fatal(): boolean { return false; } +- public log(s: string): void { +- } +- } +- +- export class LoggerAdapter implements ILogger { +- private _information: boolean; +- private _debug: boolean; +- private _warning: boolean; +- private _error: boolean; +- private _fatal: boolean; +- +- constructor (public logger: ILogger) { +- this._information = this.logger.information(); +- this._debug = this.logger.debug(); +- this._warning = this.logger.warning(); +- this._error = this.logger.error(); +- this._fatal = this.logger.fatal(); +- } +- +- +- public information(): boolean { return this._information; } +- public debug(): boolean { return this._debug; } +- public warning(): boolean { return this._warning; } +- public error(): boolean { return this._error; } +- public fatal(): boolean { return this._fatal; } +- public log(s: string): void { +- this.logger.log(s); +- } +- } +- +- export class BufferedLogger implements ILogger { +- public logContents = []; +- +- public information(): boolean { return false; } +- public debug(): boolean { return false; } +- public warning(): boolean { return false; } +- public error(): boolean { return false; } +- public fatal(): boolean { return false; } +- public log(s: string): void { +- this.logContents.push(s); +- } +- } +- +- export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { +- var start = +new Date(); +- var result = func(); +- var end = +new Date(); +- logger.log(funcDescription + " completed in " + (end - start) + " msec"); +- return result; +- } +- +- export function stringToLiteral(value: string, length: number): string { +- var result = ""; +- +- var addChar = (index: number) => { +- var ch = value.charCodeAt(index); +- switch (ch) { +- case 0x09: // tab +- result += "\\t"; +- break; +- case 0x0a: // line feed +- result += "\\n"; +- break; +- case 0x0b: // vertical tab +- result += "\\v"; +- break; +- case 0x0c: // form feed +- result += "\\f"; +- break; +- case 0x0d: // carriage return +- result += "\\r"; +- break; +- case 0x22: // double quote +- result += "\\\""; +- break; +- case 0x27: // single quote +- result += "\\\'"; +- break; +- case 0x5c: // Backslash +- result += "\\"; +- break; +- default: +- result += value.charAt(index); +- } +- } +- +- var tooLong = (value.length > length); +- if (tooLong) { +- var mid = length >> 1; +- for (var i = 0; i < mid; i++) addChar(i); +- result += "(...)"; +- for (var i = value.length - mid; i < value.length; i++) addChar(i); +- } +- else { +- length = value.length; +- for (var i = 0; i < length; i++) addChar(i); +- } +- return result; +- } +- } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff new file mode 100644 index 0000000000..302ee058f5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource10.errors.txt ++++ new.parserRealSource10.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. + parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. + parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. +@@= skipped -342, +341 lines =@@ + parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. + + +-==== parserRealSource10.ts (343 errors) ==== ++==== parserRealSource10.ts (342 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export enum TokenID { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff new file mode 100644 index 0000000000..112eb0b83a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource14.errors.txt ++++ new.parserRealSource14.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. + parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. + parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +@@= skipped -159, +158 lines =@@ + parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. + + +-==== parserRealSource14.ts (160 errors) ==== ++==== parserRealSource14.ts (159 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export function lastOf(items: any[]): any { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff new file mode 100644 index 0000000000..1474c69126 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff @@ -0,0 +1,281 @@ +--- old.parserRealSource2.errors.txt ++++ new.parserRealSource2.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource2.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- +- export function hasFlag(val: number, flag: number) { +- return (val & flag) != 0; +- } +- +- export enum ErrorRecoverySet { +- None = 0, +- Comma = 1, // Comma +- SColon = 1 << 1, // SColon +- Asg = 1 << 2, // Asg +- BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv +- // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, +- // Pct, GT, LT, And, Xor, Or +- RBrack = 1 << 4, // RBrack +- RCurly = 1 << 5, // RCurly +- RParen = 1 << 6, // RParen +- Dot = 1 << 7, // Dot +- Colon = 1 << 8, // Colon +- PrimType = 1 << 9, // number, string, boolean +- AddOp = 1 << 10, // Add, Sub +- LCurly = 1 << 11, // LCurly +- PreOp = 1 << 12, // Tilde, Bang, Inc, Dec +- RegExp = 1 << 13, // RegExp +- LParen = 1 << 14, // LParen +- LBrack = 1 << 15, // LBrack +- Scope = 1 << 16, // Scope +- In = 1 << 17, // IN +- SCase = 1 << 18, // CASE, DEFAULT +- Else = 1 << 19, // ELSE +- Catch = 1 << 20, // CATCH, FINALLY +- Var = 1 << 21, // +- Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH +- While = 1 << 23, // WHILE +- ID = 1 << 24, // ID +- Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT +- Literal = 1 << 26, // IntCon, FltCon, StrCon +- RLit = 1 << 27, // THIS, TRUE, FALSE, NULL +- Func = 1 << 28, // FUNCTION +- EOF = 1 << 29, // EOF +- +- // REVIEW: Name this something clearer. +- TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT +- ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, +- StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, +- Postfix = Dot | LParen | LBrack, +- } +- +- export enum AllowedElements { +- None = 0, +- ModuleDeclarations = 1 << 2, +- ClassDeclarations = 1 << 3, +- InterfaceDeclarations = 1 << 4, +- AmbientDeclarations = 1 << 10, +- Properties = 1 << 11, +- +- Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, +- QuickParse = Global | Properties, +- } +- +- export enum Modifiers { +- None = 0, +- Private = 1, +- Public = 1 << 1, +- Readonly = 1 << 2, +- Ambient = 1 << 3, +- Exported = 1 << 4, +- Getter = 1 << 5, +- Setter = 1 << 6, +- Static = 1 << 7, +- } +- +- export enum ASTFlags { +- None = 0, +- ExplicitSemicolon = 1, // statment terminated by an explicit semicolon +- AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon +- Writeable = 1 << 2, // node is lhs that can be modified +- Error = 1 << 3, // node has an error +- DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor +- DotLHS = 1 << 5, // node is the lhs of a dot expr +- IsStatement = 1 << 6, // node is a statement +- StrictMode = 1 << 7, // node is in the strict mode environment +- PossibleOptionalParameter = 1 << 8, +- ClassBaseConstructorCall = 1 << 9, +- OptionalName = 1 << 10, +- // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. +- // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. +- // Once we have a better way to associate information with nodes, this flag should not be used. +- SkipNextRParen = 1 << 11, +- } +- +- export enum DeclFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- } +- +- export enum ModuleFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- IsEnum = 1 << 8, +- ShouldEmitModuleDecl = 1 << 9, +- IsWholeFile = 1 << 10, +- IsDynamic = 1 << 11, +- MustCaptureThis = 1 << 12, +- } +- +- export enum SymbolFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- Property = 1 << 8, +- Readonly = 1 << 9, +- ModuleMember = 1 << 10, +- InterfaceMember = 1 << 11, +- ClassMember = 1 << 12, +- BuiltIn = 1 << 13, +- TypeSetDuringScopeAssignment = 1 << 14, +- Constant = 1 << 15, +- Optional = 1 << 16, +- RecursivelyReferenced = 1 << 17, +- Bound = 1 << 18, +- CompilerGenerated = 1 << 19, +- } +- +- export enum VarFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- AutoInit = 1 << 8, +- Property = 1 << 9, +- Readonly = 1 << 10, +- Class = 1 << 11, +- ClassProperty = 1 << 12, +- ClassBodyProperty = 1 << 13, +- ClassConstructorProperty = 1 << 14, +- ClassSuperMustBeFirstCallInConstructor = 1 << 15, +- Constant = 1 << 16, +- MustCaptureThis = 1 << 17, +- } +- +- export enum FncFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- Definition = 1 << 8, +- Signature = 1 << 9, +- Method = 1 << 10, +- HasReturnExpression = 1 << 11, +- CallMember = 1 << 12, +- ConstructMember = 1 << 13, +- HasSelfReference = 1 << 14, +- IsFatArrowFunction = 1 << 15, +- IndexerMember = 1 << 16, +- IsFunctionExpression = 1 << 17, +- ClassMethod = 1 << 18, +- ClassPropertyMethodExported = 1 << 19, +- } +- +- export enum SignatureFlags { +- None = 0, +- IsIndexer = 1, +- IsStringIndexer = 1 << 1, +- IsNumberIndexer = 1 << 2, +- } +- +- export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; +- export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; +- export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; +- export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; +- export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { +- return fncOrVarOrSymbolOrModuleFlags; +- } +- +- export enum TypeFlags { +- None = 0, +- HasImplementation = 1, +- HasSelfReference = 1 << 1, +- MergeResult = 1 << 2, +- IsEnum = 1 << 3, +- BuildingName = 1 << 4, +- HasBaseType = 1 << 5, +- HasBaseTypeOfObject = 1 << 6, +- IsClass = 1 << 7, +- } +- +- export enum TypeRelationshipFlags { +- SuccessfulComparison = 0, +- SourceIsNullTargetIsVoidOrUndefined = 1, +- RequiredPropertyIsMissing = 1 << 1, +- IncompatibleSignatures = 1 << 2, +- SourceSignatureHasTooManyParameters = 3, +- IncompatibleReturnTypes = 1 << 4, +- IncompatiblePropertyTypes = 1 << 5, +- IncompatibleParameterTypes = 1 << 6, +- } +- +- export enum CodeGenTarget { +- ES3 = 0, +- ES5 = 1, +- } +- +- export enum ModuleGenTarget { +- Synchronous = 0, +- Asynchronous = 1, +- Local = 1 << 1, +- } +- +- // Compiler defaults to generating ES5-compliant code for +- // - getters and setters +- export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; +- +- export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; +- +- export var optimizeModuleCodeGen = true; +- +- export function flagsToString(e, flags: number): string { +- var builder = ""; +- for (var i = 1; i < (1 << 31) ; i = i << 1) { +- if ((flags & i) != 0) { +- for (var k in e) { +- if (e[k] == i) { +- if (builder.length > 0) { +- builder += "|"; +- } +- builder += k; +- break; +- } +- } +- } +- } +- return builder; +- } +- +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff new file mode 100644 index 0000000000..abd13c93f3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff @@ -0,0 +1,129 @@ +--- old.parserRealSource3.errors.txt ++++ new.parserRealSource3.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource3.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback +- export enum NodeType { +- None, +- Empty, +- EmptyExpr, +- True, +- False, +- This, +- Super, +- QString, +- Regex, +- Null, +- ArrayLit, +- ObjectLit, +- Void, +- Comma, +- Pos, +- Neg, +- Delete, +- Await, +- In, +- Dot, +- From, +- Is, +- InstOf, +- Typeof, +- NumberLit, +- Name, +- TypeRef, +- Index, +- Call, +- New, +- Asg, +- AsgAdd, +- AsgSub, +- AsgDiv, +- AsgMul, +- AsgMod, +- AsgAnd, +- AsgXor, +- AsgOr, +- AsgLsh, +- AsgRsh, +- AsgRs2, +- ConditionalExpression, +- LogOr, +- LogAnd, +- Or, +- Xor, +- And, +- Eq, +- Ne, +- Eqv, +- NEqv, +- Lt, +- Le, +- Gt, +- Ge, +- Add, +- Sub, +- Mul, +- Div, +- Mod, +- Lsh, +- Rsh, +- Rs2, +- Not, +- LogNot, +- IncPre, +- DecPre, +- IncPost, +- DecPost, +- TypeAssertion, +- FuncDecl, +- Member, +- VarDecl, +- ArgDecl, +- Return, +- Break, +- Continue, +- Throw, +- For, +- ForIn, +- If, +- While, +- DoWhile, +- Block, +- Case, +- Switch, +- Try, +- TryCatch, +- TryFinally, +- Finally, +- Catch, +- List, +- Script, +- ClassDeclaration, +- InterfaceDeclaration, +- ModuleDeclaration, +- ImportDeclaration, +- With, +- Label, +- LabeledStatement, +- EBStart, +- GotoEB, +- EndCode, +- Error, +- Comment, +- Debugger, +- GeneralNode = FuncDecl, +- LastAsg = AsgRs2, +- } +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff new file mode 100644 index 0000000000..a20c55edde --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.parserRealSource4.errors.txt ++++ new.parserRealSource4.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. + + +-==== parserRealSource4.ts (2 errors) ==== ++==== parserRealSource4.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff new file mode 100644 index 0000000000..5c7ec99caf --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource5.errors.txt ++++ new.parserRealSource5.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. + parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. + parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. +@@= skipped -8, +7 lines =@@ + parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. + + +-==== parserRealSource5.ts (9 errors) ==== ++==== parserRealSource5.ts (8 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + // TODO: refactor indent logic for use in emit \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff new file mode 100644 index 0000000000..2d8965d4df --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff @@ -0,0 +1,19 @@ +--- old.scannertest1.errors.txt ++++ new.scannertest1.errors.txt +@@= skipped -0, +0 lines =@@ +-scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. + scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. + scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. + scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? +@@= skipped -15, +14 lines =@@ + scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. + + +-==== scannertest1.ts (16 errors) ==== ++==== scannertest1.ts (15 errors) ==== + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'References.ts' not found. + + class CharacterInfo { + public static isDecimalDigit(c: number): boolean { \ No newline at end of file From eadc7bf990d80249ead10559ce5b2be0369ee9d3 Mon Sep 17 00:00:00 2001 From: han Date: Wed, 19 Nov 2025 21:32:07 +0000 Subject: [PATCH 12/22] update new baseline --- internal/compiler/program.go | 30 +- ...declarationEmitInvalidReference.errors.txt | 8 + ...rationEmitInvalidReference.errors.txt.diff | 12 + ...eclarationEmitInvalidReference2.errors.txt | 8 + ...ationEmitInvalidReference2.errors.txt.diff | 12 - ...tionEmitInvalidReferenceAllowJs.errors.txt | 9 + ...mitInvalidReferenceAllowJs.errors.txt.diff | 17 +- ...uplicateIdentifierRelatedSpans6.errors.txt | 11 +- ...ateIdentifierRelatedSpans6.errors.txt.diff | 11 +- ...uplicateIdentifierRelatedSpans7.errors.txt | 11 +- ...ateIdentifierRelatedSpans7.errors.txt.diff | 20 +- .../fileReferencesWithNoExtensions.errors.txt | 31 ++ ...ReferencesWithNoExtensions.errors.txt.diff | 35 +++ .../invalidTripleSlashReference.errors.txt | 14 + ...nvalidTripleSlashReference.errors.txt.diff | 18 -- ...tionDuringSyntheticDefaultCheck.errors.txt | 38 +++ ...uringSyntheticDefaultCheck.errors.txt.diff | 42 +++ .../compiler/selfReferencingFile2.errors.txt | 11 + .../selfReferencingFile2.errors.txt.diff | 20 +- .../conformance/parserRealSource1.errors.txt | 160 ++++++++++ .../parserRealSource1.errors.txt.diff | 164 ---------- .../conformance/parserRealSource10.errors.txt | 5 +- .../parserRealSource10.errors.txt.diff | 22 -- .../conformance/parserRealSource11.errors.txt | 5 +- .../parserRealSource11.errors.txt.diff | 24 +- .../conformance/parserRealSource12.errors.txt | 5 +- .../parserRealSource12.errors.txt.diff | 24 +- .../conformance/parserRealSource13.errors.txt | 5 +- .../parserRealSource13.errors.txt.diff | 27 +- .../conformance/parserRealSource14.errors.txt | 5 +- .../parserRealSource14.errors.txt.diff | 22 -- .../conformance/parserRealSource2.errors.txt | 277 +++++++++++++++++ .../parserRealSource2.errors.txt.diff | 281 ------------------ .../conformance/parserRealSource3.errors.txt | 125 ++++++++ .../parserRealSource3.errors.txt.diff | 129 -------- .../conformance/parserRealSource4.errors.txt | 5 +- .../parserRealSource4.errors.txt.diff | 18 -- .../conformance/parserRealSource5.errors.txt | 5 +- .../parserRealSource5.errors.txt.diff | 22 -- .../conformance/parserRealSource6.errors.txt | 5 +- .../parserRealSource6.errors.txt.diff | 24 +- .../conformance/parserRealSource7.errors.txt | 5 +- .../parserRealSource7.errors.txt.diff | 24 +- .../conformance/parserRealSource8.errors.txt | 5 +- .../parserRealSource8.errors.txt.diff | 27 +- .../conformance/parserRealSource9.errors.txt | 5 +- .../parserRealSource9.errors.txt.diff | 22 +- .../conformance/parserharness.errors.txt | 14 +- .../conformance/parserharness.errors.txt.diff | 41 ++- .../conformance/parserindenter.errors.txt | 5 +- .../parserindenter.errors.txt.diff | 27 +- .../conformance/scannertest1.errors.txt | 5 +- .../conformance/scannertest1.errors.txt.diff | 19 -- ...ror-if-input-file-is-missing-with-force.js | 19 +- .../reports-error-if-input-file-is-missing.js | 19 +- .../commandLine/Parse-enum-type-options.js | 6 +- ...le-is-added,-the-signatures-are-updated.js | 127 ++++++-- ...eferenced-project-doesnt-have-composite.js | 11 +- ...g-when-module-reference-is-not-relative.js | 27 +- ...ce-error-when-the-input-file-is-missing.js | 27 +- .../when-project-reference-is-not-built.js | 4 +- ...eferences-composite-project-with-noEmit.js | 11 +- 62 files changed, 1125 insertions(+), 1042 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff diff --git a/internal/compiler/program.go b/internal/compiler/program.go index d0bccfe7e5..5601f72dbe 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1226,31 +1226,27 @@ func (p *Program) getDiagnosticsHelper(ctx context.Context, sourceFile *ast.Sour func (p *Program) addProgramDiagnostics() { for _, m := range p.missingFiles { reason := m.reason - data, ok := reason.data.(*referencedFileData) - if !ok { - continue - } - - parent := p.filesByPath[data.file] - if parent == nil { - continue - } + var location core.TextRange + var parent *ast.SourceFile + var ref *ast.FileReference + + if data, ok := reason.data.(*referencedFileData); ok { + parent = p.filesByPath[data.file] + if parent != nil && data.index < len(parent.ReferencedFiles) { + ref = parent.ReferencedFiles[data.index] + location = ref.TextRange + } - ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { - return r.FileName == m.path - }) - if ref == nil { - continue } - diagnostic := ast.NewDiagnostic( + diag := ast.NewDiagnostic( parent, - ref.TextRange, + location, diagnostics.File_0_not_found, m.path, ) - p.programDiagnostics = append(p.programDiagnostics, diagnostic) + p.programDiagnostics = append(p.programDiagnostics, diag) } } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt new file mode 100644 index 0000000000..3410b755ed --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt @@ -0,0 +1,8 @@ +declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. + + +==== declarationEmitInvalidReference.ts (1 errors) ==== + /// + ~~~~~~~~~~ +!!! error TS6053: File 'invalid.ts' not found. + var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff new file mode 100644 index 0000000000..ec4fa6df36 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff @@ -0,0 +1,12 @@ +--- old.declarationEmitInvalidReference.errors.txt ++++ new.declarationEmitInvalidReference.errors.txt +@@= skipped -0, +0 lines =@@ +- ++declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. ++ ++ ++==== declarationEmitInvalidReference.ts (1 errors) ==== ++ /// ++ ~~~~~~~~~~ ++!!! error TS6053: File 'invalid.ts' not found. ++ var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt new file mode 100644 index 0000000000..ab08b44a07 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt @@ -0,0 +1,8 @@ +declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. + + +==== declarationEmitInvalidReference2.ts (1 errors) ==== + /// + ~~~~~~~~~~ +!!! error TS6053: File 'invalid.ts' not found. + var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff deleted file mode 100644 index ba50881c9f..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.declarationEmitInvalidReference2.errors.txt -+++ new.declarationEmitInvalidReference2.errors.txt -@@= skipped -0, +0 lines =@@ --declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. -- -- --==== declarationEmitInvalidReference2.ts (1 errors) ==== -- /// -- ~~~~~~~~~~ --!!! error TS6053: File 'invalid.ts' not found. -- var x = 0; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt new file mode 100644 index 0000000000..901eb88671 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt @@ -0,0 +1,9 @@ +declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. + + +==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== + /// + ~~~~~~~ +!!! error TS6053: File 'invalid' not found. + var x = 0; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff index 784414cf18..eac8c72787 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff @@ -2,12 +2,13 @@ +++ new.declarationEmitInvalidReferenceAllowJs.errors.txt @@= skipped -0, +0 lines =@@ -declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6231: Could not resolve the path 'invalid' with the extensions: '.ts', '.tsx', '.d.ts', '.js', '.jsx', '.cts', '.d.cts', '.cjs', '.mts', '.d.mts', '.mjs'. -- -- --==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== -- /// -- ~~~~~~~ ++declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. + + + ==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== + /// + ~~~~~~~ -!!! error TS6231: Could not resolve the path 'invalid' with the extensions: '.ts', '.tsx', '.d.ts', '.js', '.jsx', '.cts', '.d.cts', '.cjs', '.mts', '.d.mts', '.mjs'. -- var x = 0; -- -+ \ No newline at end of file ++!!! error TS6053: File 'invalid' not found. + var x = 0; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt index 6fe169252b..620f9be95c 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt @@ -1,11 +1,18 @@ +file2.ts:1:22 - error TS6053: File 'file1' not found. + +1 /// +   ~~~~~~~ + file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" {    ~~~~~~~~~ -==== file2.ts (1 errors) ==== +==== file2.ts (2 errors) ==== /// + ~~~~~~~ +!!! error TS6053: File 'file1' not found. declare module "someMod" { ~~~~~~~~~ @@ -26,5 +33,5 @@ duplicate3: () => string; } } -Found 1 error in file2.ts:3 +Found 2 errors in the same file, starting at: file2.ts:1 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff index e6fb256ad7..b00da8ee22 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff @@ -58,14 +58,21 @@ - - -==== file2.ts (3 errors) ==== ++file2.ts:1:22 - error TS6053: File 'file1' not found. ++ ++1 /// ++   ~~~~~~~ ++ +file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. + +3 declare module "someMod" { +   ~~~~~~~~~ + + -+==== file2.ts (1 errors) ==== ++==== file2.ts (2 errors) ==== /// ++ ~~~~~~~ ++!!! error TS6053: File 'file1' not found. declare module "someMod" { + ~~~~~~~~~ @@ -106,7 +113,7 @@ } } -Found 6 errors in 2 files. -+Found 1 error in file2.ts:3 ++Found 2 errors in the same file, starting at: file2.ts:1 -Errors Files - 3 file1.ts:3 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt index 11fcb89173..3f962517ec 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt @@ -1,11 +1,18 @@ +file2.ts:1:22 - error TS6053: File 'file1' not found. + +1 /// +   ~~~~~~~ + file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" {    ~~~~~~~~~ -==== file2.ts (1 errors) ==== +==== file2.ts (2 errors) ==== /// + ~~~~~~~ +!!! error TS6053: File 'file1' not found. declare module "someMod" { ~~~~~~~~~ @@ -38,5 +45,5 @@ duplicate9: () => string; } } -Found 1 error in file2.ts:3 +Found 2 errors in the same file, starting at: file2.ts:1 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff index 5ea72c878c..10d29930ae 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff @@ -11,6 +11,11 @@ -   ~~~~~~~ - Conflicts are in this file. -file2.ts:3:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: duplicate1, duplicate2, duplicate3, duplicate4, duplicate5, duplicate6, duplicate7, duplicate8, duplicate9 ++file2.ts:1:22 - error TS6053: File 'file1' not found. ++ ++1 /// ++   ~~~~~~~ ++ +file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" { @@ -20,11 +25,16 @@ - 1 declare module "someMod" { -   ~~~~~~~ - Conflicts are in this file. +- +- +-==== file2.ts (1 errors) ==== +   ~~~~~~~~~ - - - ==== file2.ts (1 errors) ==== ++ ++ ++==== file2.ts (2 errors) ==== /// ++ ~~~~~~~ ++!!! error TS6053: File 'file1' not found. declare module "someMod" { - ~~~~~~~ @@ -35,7 +45,7 @@ export interface TopLevel { duplicate1(): number; duplicate2(): number; -@@= skipped -38, +23 lines =@@ +@@= skipped -38, +30 lines =@@ } export {}; @@ -53,7 +63,7 @@ } } -Found 2 errors in 2 files. -+Found 1 error in file2.ts:3 ++Found 2 errors in the same file, starting at: file2.ts:1 -Errors Files - 1 file1.ts:1 diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt new file mode 100644 index 0000000000..e90dfea033 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt @@ -0,0 +1,31 @@ +t.ts(1,22): error TS6053: File 'a' not found. +t.ts(2,22): error TS6053: File 'b' not found. +t.ts(3,22): error TS6053: File 'c' not found. + + +==== t.ts (3 errors) ==== + /// + ~ +!!! error TS6053: File 'a' not found. + /// + ~ +!!! error TS6053: File 'b' not found. + /// + ~ +!!! error TS6053: File 'c' not found. + var a = aa; // Check that a.ts is referenced + var b = bb; // Check that b.d.ts is referenced + var c = cc; // Check that c.ts has precedence over c.d.ts + +==== a.ts (0 errors) ==== + var aa = 1; + +==== b.d.ts (0 errors) ==== + declare var bb: number; + +==== c.ts (0 errors) ==== + var cc = 1; + +==== c.d.ts (0 errors) ==== + declare var xx: number; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff new file mode 100644 index 0000000000..6f5fce09fe --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff @@ -0,0 +1,35 @@ +--- old.fileReferencesWithNoExtensions.errors.txt ++++ new.fileReferencesWithNoExtensions.errors.txt +@@= skipped -0, +0 lines =@@ +- ++t.ts(1,22): error TS6053: File 'a' not found. ++t.ts(2,22): error TS6053: File 'b' not found. ++t.ts(3,22): error TS6053: File 'c' not found. ++ ++ ++==== t.ts (3 errors) ==== ++ /// ++ ~ ++!!! error TS6053: File 'a' not found. ++ /// ++ ~ ++!!! error TS6053: File 'b' not found. ++ /// ++ ~ ++!!! error TS6053: File 'c' not found. ++ var a = aa; // Check that a.ts is referenced ++ var b = bb; // Check that b.d.ts is referenced ++ var c = cc; // Check that c.ts has precedence over c.d.ts ++ ++==== a.ts (0 errors) ==== ++ var aa = 1; ++ ++==== b.d.ts (0 errors) ==== ++ declare var bb: number; ++ ++==== c.ts (0 errors) ==== ++ var cc = 1; ++ ++==== c.d.ts (0 errors) ==== ++ declare var xx: number; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt new file mode 100644 index 0000000000..ee64719ef0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt @@ -0,0 +1,14 @@ +invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. +invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. + + +==== invalidTripleSlashReference.ts (2 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File 'filedoesnotexist.ts' not found. + /// + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. + + // this test doesn't actually give the errors you want due to the way the compiler reports errors + var x = 1; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff deleted file mode 100644 index dda05feefc..0000000000 --- a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.invalidTripleSlashReference.errors.txt -+++ new.invalidTripleSlashReference.errors.txt -@@= skipped -0, +0 lines =@@ --invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. --invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. -- -- --==== invalidTripleSlashReference.ts (2 errors) ==== -- /// -- ~~~~~~~~~~~~~~~~~~~ --!!! error TS6053: File 'filedoesnotexist.ts' not found. -- /// -- ~~~~~~~~~~~~~~~~~~~~~~ --!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. -- -- // this test doesn't actually give the errors you want due to the way the compiler reports errors -- var x = 1; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt new file mode 100644 index 0000000000..50418426f3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt @@ -0,0 +1,38 @@ +idx.test.ts(1,22): error TS6053: File 'idx' not found. + + +==== idx.test.ts (1 errors) ==== + /// + ~~~~~ +!!! error TS6053: File 'idx' not found. + + import moment = require("moment-timezone"); + +==== node_modules/moment/index.d.ts (0 errors) ==== + declare function moment(): moment.Moment; + declare namespace moment { + interface Moment extends Object { + valueOf(): number; + } + } + export = moment; +==== node_modules/moment-timezone/index.d.ts (0 errors) ==== + import * as moment from 'moment'; + export = moment; + declare module "moment" { + interface Moment { + tz(): string; + } + } +==== idx.ts (0 errors) ==== + import * as _moment from "moment"; + declare module "moment" { + interface Moment { + strftime(pattern: string): string; + } + } + declare module "moment-timezone" { + interface Moment { + strftime(pattern: string): string; + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff new file mode 100644 index 0000000000..b4f94274de --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff @@ -0,0 +1,42 @@ +--- old.moduleAugmentationDuringSyntheticDefaultCheck.errors.txt ++++ new.moduleAugmentationDuringSyntheticDefaultCheck.errors.txt +@@= skipped -0, +0 lines =@@ +- ++idx.test.ts(1,22): error TS6053: File 'idx' not found. ++ ++ ++==== idx.test.ts (1 errors) ==== ++ /// ++ ~~~~~ ++!!! error TS6053: File 'idx' not found. ++ ++ import moment = require("moment-timezone"); ++ ++==== node_modules/moment/index.d.ts (0 errors) ==== ++ declare function moment(): moment.Moment; ++ declare namespace moment { ++ interface Moment extends Object { ++ valueOf(): number; ++ } ++ } ++ export = moment; ++==== node_modules/moment-timezone/index.d.ts (0 errors) ==== ++ import * as moment from 'moment'; ++ export = moment; ++ declare module "moment" { ++ interface Moment { ++ tz(): string; ++ } ++ } ++==== idx.ts (0 errors) ==== ++ import * as _moment from "moment"; ++ declare module "moment" { ++ interface Moment { ++ strftime(pattern: string): string; ++ } ++ } ++ declare module "moment-timezone" { ++ interface Moment { ++ strftime(pattern: string): string; ++ } ++ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt new file mode 100644 index 0000000000..4b455001c3 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt @@ -0,0 +1,11 @@ +selfReferencingFile2.ts(1,21): error TS6053: File '/selfReferencingFile2.ts' not found. + + +==== selfReferencingFile2.ts (1 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File '/selfReferencingFile2.ts' not found. + + class selfReferencingFile2 { + + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff index 4492eec599..8012bac954 100644 --- a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff @@ -2,14 +2,14 @@ +++ new.selfReferencingFile2.errors.txt @@= skipped -0, +0 lines =@@ -selfReferencingFile2.ts(1,21): error TS6053: File '../selfReferencingFile2.ts' not found. -- -- --==== selfReferencingFile2.ts (1 errors) ==== -- /// -- ~~~~~~~~~~~~~~~~~~~~~~~~~~ ++selfReferencingFile2.ts(1,21): error TS6053: File '/selfReferencingFile2.ts' not found. + + + ==== selfReferencingFile2.ts (1 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../selfReferencingFile2.ts' not found. -- -- class selfReferencingFile2 { -- -- } -+ \ No newline at end of file ++!!! error TS6053: File '/selfReferencingFile2.ts' not found. + + class selfReferencingFile2 { + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt new file mode 100644 index 0000000000..e7d69ba104 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt @@ -0,0 +1,160 @@ +parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource1.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export module CompilerDiagnostics { + export var debug = false; + export interface IDiagnosticWriter { + Alert(output: string): void; + } + + export var diagnosticWriter: IDiagnosticWriter = null; + + export var analysisPass: number = 0; + + export function Alert(output: string) { + if (diagnosticWriter) { + diagnosticWriter.Alert(output); + } + } + + export function debugPrint(s: string) { + if (debug) { + Alert(s); + } + } + + export function assert(condition: boolean, s: string) { + if (debug) { + if (!condition) { + Alert(s); + } + } + } + + } + + export interface ILogger { + information(): boolean; + debug(): boolean; + warning(): boolean; + error(): boolean; + fatal(): boolean; + log(s: string): void; + } + + export class NullLogger implements ILogger { + public information(): boolean { return false; } + public debug(): boolean { return false; } + public warning(): boolean { return false; } + public error(): boolean { return false; } + public fatal(): boolean { return false; } + public log(s: string): void { + } + } + + export class LoggerAdapter implements ILogger { + private _information: boolean; + private _debug: boolean; + private _warning: boolean; + private _error: boolean; + private _fatal: boolean; + + constructor (public logger: ILogger) { + this._information = this.logger.information(); + this._debug = this.logger.debug(); + this._warning = this.logger.warning(); + this._error = this.logger.error(); + this._fatal = this.logger.fatal(); + } + + + public information(): boolean { return this._information; } + public debug(): boolean { return this._debug; } + public warning(): boolean { return this._warning; } + public error(): boolean { return this._error; } + public fatal(): boolean { return this._fatal; } + public log(s: string): void { + this.logger.log(s); + } + } + + export class BufferedLogger implements ILogger { + public logContents = []; + + public information(): boolean { return false; } + public debug(): boolean { return false; } + public warning(): boolean { return false; } + public error(): boolean { return false; } + public fatal(): boolean { return false; } + public log(s: string): void { + this.logContents.push(s); + } + } + + export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { + var start = +new Date(); + var result = func(); + var end = +new Date(); + logger.log(funcDescription + " completed in " + (end - start) + " msec"); + return result; + } + + export function stringToLiteral(value: string, length: number): string { + var result = ""; + + var addChar = (index: number) => { + var ch = value.charCodeAt(index); + switch (ch) { + case 0x09: // tab + result += "\\t"; + break; + case 0x0a: // line feed + result += "\\n"; + break; + case 0x0b: // vertical tab + result += "\\v"; + break; + case 0x0c: // form feed + result += "\\f"; + break; + case 0x0d: // carriage return + result += "\\r"; + break; + case 0x22: // double quote + result += "\\\""; + break; + case 0x27: // single quote + result += "\\\'"; + break; + case 0x5c: // Backslash + result += "\\"; + break; + default: + result += value.charAt(index); + } + } + + var tooLong = (value.length > length); + if (tooLong) { + var mid = length >> 1; + for (var i = 0; i < mid; i++) addChar(i); + result += "(...)"; + for (var i = value.length - mid; i < value.length; i++) addChar(i); + } + else { + length = value.length; + for (var i = 0; i < length; i++) addChar(i); + } + return result; + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff deleted file mode 100644 index e4a0e97966..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff +++ /dev/null @@ -1,164 +0,0 @@ ---- old.parserRealSource1.errors.txt -+++ new.parserRealSource1.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource1.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- export module CompilerDiagnostics { -- export var debug = false; -- export interface IDiagnosticWriter { -- Alert(output: string): void; -- } -- -- export var diagnosticWriter: IDiagnosticWriter = null; -- -- export var analysisPass: number = 0; -- -- export function Alert(output: string) { -- if (diagnosticWriter) { -- diagnosticWriter.Alert(output); -- } -- } -- -- export function debugPrint(s: string) { -- if (debug) { -- Alert(s); -- } -- } -- -- export function assert(condition: boolean, s: string) { -- if (debug) { -- if (!condition) { -- Alert(s); -- } -- } -- } -- -- } -- -- export interface ILogger { -- information(): boolean; -- debug(): boolean; -- warning(): boolean; -- error(): boolean; -- fatal(): boolean; -- log(s: string): void; -- } -- -- export class NullLogger implements ILogger { -- public information(): boolean { return false; } -- public debug(): boolean { return false; } -- public warning(): boolean { return false; } -- public error(): boolean { return false; } -- public fatal(): boolean { return false; } -- public log(s: string): void { -- } -- } -- -- export class LoggerAdapter implements ILogger { -- private _information: boolean; -- private _debug: boolean; -- private _warning: boolean; -- private _error: boolean; -- private _fatal: boolean; -- -- constructor (public logger: ILogger) { -- this._information = this.logger.information(); -- this._debug = this.logger.debug(); -- this._warning = this.logger.warning(); -- this._error = this.logger.error(); -- this._fatal = this.logger.fatal(); -- } -- -- -- public information(): boolean { return this._information; } -- public debug(): boolean { return this._debug; } -- public warning(): boolean { return this._warning; } -- public error(): boolean { return this._error; } -- public fatal(): boolean { return this._fatal; } -- public log(s: string): void { -- this.logger.log(s); -- } -- } -- -- export class BufferedLogger implements ILogger { -- public logContents = []; -- -- public information(): boolean { return false; } -- public debug(): boolean { return false; } -- public warning(): boolean { return false; } -- public error(): boolean { return false; } -- public fatal(): boolean { return false; } -- public log(s: string): void { -- this.logContents.push(s); -- } -- } -- -- export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { -- var start = +new Date(); -- var result = func(); -- var end = +new Date(); -- logger.log(funcDescription + " completed in " + (end - start) + " msec"); -- return result; -- } -- -- export function stringToLiteral(value: string, length: number): string { -- var result = ""; -- -- var addChar = (index: number) => { -- var ch = value.charCodeAt(index); -- switch (ch) { -- case 0x09: // tab -- result += "\\t"; -- break; -- case 0x0a: // line feed -- result += "\\n"; -- break; -- case 0x0b: // vertical tab -- result += "\\v"; -- break; -- case 0x0c: // form feed -- result += "\\f"; -- break; -- case 0x0d: // carriage return -- result += "\\r"; -- break; -- case 0x22: // double quote -- result += "\\\""; -- break; -- case 0x27: // single quote -- result += "\\\'"; -- break; -- case 0x5c: // Backslash -- result += "\\"; -- break; -- default: -- result += value.charAt(index); -- } -- } -- -- var tooLong = (value.length > length); -- if (tooLong) { -- var mid = length >> 1; -- for (var i = 0; i < mid; i++) addChar(i); -- result += "(...)"; -- for (var i = value.length - mid; i < value.length; i++) addChar(i); -- } -- else { -- length = value.length; -- for (var i = 0; i < length; i++) addChar(i); -- } -- return result; -- } -- } -- -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt index d910c1c159..e0e0ea045a 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt @@ -1,3 +1,4 @@ +parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -342,11 +343,13 @@ parserRealSource10.ts(356,53): error TS2304: Cannot find name 'NodeType'. parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. -==== parserRealSource10.ts (342 errors) ==== +==== parserRealSource10.ts (343 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export enum TokenID { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff deleted file mode 100644 index 302ee058f5..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource10.errors.txt -+++ new.parserRealSource10.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. - parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. - parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. -@@= skipped -342, +341 lines =@@ - parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. - - --==== parserRealSource10.ts (343 errors) ==== -+==== parserRealSource10.ts (342 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export enum TokenID { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt index 301c863fe3..4584962cc2 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt @@ -1,3 +1,4 @@ +parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -510,11 +511,13 @@ parserRealSource11.ts(2356,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== parserRealSource11.ts (510 errors) ==== +==== parserRealSource11.ts (511 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class ASTSpan { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff index 81f82295d6..73ab595bfe 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource11.errors.txt +++ new.parserRealSource11.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. - parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. - parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. -@@= skipped -44, +43 lines =@@ +@@= skipped -44, +44 lines =@@ parserRealSource11.ts(219,33): error TS2304: Cannot find name 'NodeType'. parserRealSource11.ts(231,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(231,48): error TS2304: Cannot find name 'TokenID'. @@ -278,22 +273,7 @@ parserRealSource11.ts(2312,42): error TS2304: Cannot find name 'ControlFlowContext'. parserRealSource11.ts(2320,36): error TS2304: Cannot find name 'TypeFlow'. parserRealSource11.ts(2331,19): error TS2304: Cannot find name 'NodeType'. -@@= skipped -9, +9 lines =@@ - parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. - - --==== parserRealSource11.ts (511 errors) ==== -+==== parserRealSource11.ts (510 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export class ASTSpan { -@@= skipped -329, +327 lines =@@ +@@= skipped -338, +338 lines =@@ emitter.recordSourceMappingStart(this); emitter.emitJavascriptList(this, null, TokenID.Semicolon, startLine, false, false); ~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt index 469eb6ebc9..65f0af9317 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt @@ -1,3 +1,4 @@ +parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. @@ -208,11 +209,13 @@ parserRealSource12.ts(523,88): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. -==== parserRealSource12.ts (208 errors) ==== +==== parserRealSource12.ts (209 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export interface IAstWalker { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff index 5a68c67dd6..9d0f9c4570 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource12.errors.txt +++ new.parserRealSource12.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. - parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. - parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. -@@= skipped -154, +153 lines =@@ +@@= skipped -154, +154 lines =@@ parserRealSource12.ts(371,84): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(378,62): error TS2304: Cannot find name 'DoWhileStatement'. parserRealSource12.ts(378,88): error TS2304: Cannot find name 'AST'. @@ -41,22 +36,7 @@ parserRealSource12.ts(465,81): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(469,39): error TS2304: Cannot find name 'ASTList'. parserRealSource12.ts(473,42): error TS2304: Cannot find name 'ASTList'. -@@= skipped -40, +40 lines =@@ - parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. - - --==== parserRealSource12.ts (209 errors) ==== -+==== parserRealSource12.ts (208 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export interface IAstWalker { -@@= skipped -701, +699 lines =@@ +@@= skipped -741, +741 lines =@@ export function walkBlockChildren(preAst: Block, parent: AST, walker: IAstWalker): void { ~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt index edd2adfa16..45a111a3a4 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt @@ -1,3 +1,4 @@ +parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. @@ -115,11 +116,13 @@ parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? -==== parserRealSource13.ts (115 errors) ==== +==== parserRealSource13.ts (116 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { export interface AstWalkerDetailCallback { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff index 589c40b732..d59cc36493 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource13.errors.txt +++ new.parserRealSource13.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. - parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. - parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. -@@= skipped -81, +80 lines =@@ +@@= skipped -81, +81 lines =@@ parserRealSource13.ts(88,32): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(89,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(90,37): error TS2304: Cannot find name 'AST'. @@ -19,23 +14,11 @@ parserRealSource13.ts(128,33): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. -parserRealSource13.ts(135,36): error TS2304: Cannot find name 'NodeType'. -- -- --==== parserRealSource13.ts (116 errors) ==== +parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? -+ -+ -+==== parserRealSource13.ts (115 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript.AstWalkerWithDetailCallback { - export interface AstWalkerDetailCallback { -@@= skipped -264, +262 lines =@@ + + + ==== parserRealSource13.ts (116 errors) ==== +@@= skipped -264, +264 lines =@@ !!! error TS2304: Cannot find name 'AST'. BlockCallback? (pre, block: Block): boolean; ~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt index cee28fce0c..417b0c7c6b 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt @@ -1,3 +1,4 @@ +parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. @@ -159,11 +160,13 @@ parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no expor parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource14.ts (159 errors) ==== +==== parserRealSource14.ts (160 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export function lastOf(items: any[]): any { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff deleted file mode 100644 index 112eb0b83a..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource14.errors.txt -+++ new.parserRealSource14.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. - parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. - parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. -@@= skipped -159, +158 lines =@@ - parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. - - --==== parserRealSource14.ts (160 errors) ==== -+==== parserRealSource14.ts (159 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export function lastOf(items: any[]): any { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt new file mode 100644 index 0000000000..fe21785dbd --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt @@ -0,0 +1,277 @@ +parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource2.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + + export function hasFlag(val: number, flag: number) { + return (val & flag) != 0; + } + + export enum ErrorRecoverySet { + None = 0, + Comma = 1, // Comma + SColon = 1 << 1, // SColon + Asg = 1 << 2, // Asg + BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv + // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, + // Pct, GT, LT, And, Xor, Or + RBrack = 1 << 4, // RBrack + RCurly = 1 << 5, // RCurly + RParen = 1 << 6, // RParen + Dot = 1 << 7, // Dot + Colon = 1 << 8, // Colon + PrimType = 1 << 9, // number, string, boolean + AddOp = 1 << 10, // Add, Sub + LCurly = 1 << 11, // LCurly + PreOp = 1 << 12, // Tilde, Bang, Inc, Dec + RegExp = 1 << 13, // RegExp + LParen = 1 << 14, // LParen + LBrack = 1 << 15, // LBrack + Scope = 1 << 16, // Scope + In = 1 << 17, // IN + SCase = 1 << 18, // CASE, DEFAULT + Else = 1 << 19, // ELSE + Catch = 1 << 20, // CATCH, FINALLY + Var = 1 << 21, // + Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH + While = 1 << 23, // WHILE + ID = 1 << 24, // ID + Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT + Literal = 1 << 26, // IntCon, FltCon, StrCon + RLit = 1 << 27, // THIS, TRUE, FALSE, NULL + Func = 1 << 28, // FUNCTION + EOF = 1 << 29, // EOF + + // REVIEW: Name this something clearer. + TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT + ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, + StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, + Postfix = Dot | LParen | LBrack, + } + + export enum AllowedElements { + None = 0, + ModuleDeclarations = 1 << 2, + ClassDeclarations = 1 << 3, + InterfaceDeclarations = 1 << 4, + AmbientDeclarations = 1 << 10, + Properties = 1 << 11, + + Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, + QuickParse = Global | Properties, + } + + export enum Modifiers { + None = 0, + Private = 1, + Public = 1 << 1, + Readonly = 1 << 2, + Ambient = 1 << 3, + Exported = 1 << 4, + Getter = 1 << 5, + Setter = 1 << 6, + Static = 1 << 7, + } + + export enum ASTFlags { + None = 0, + ExplicitSemicolon = 1, // statment terminated by an explicit semicolon + AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon + Writeable = 1 << 2, // node is lhs that can be modified + Error = 1 << 3, // node has an error + DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor + DotLHS = 1 << 5, // node is the lhs of a dot expr + IsStatement = 1 << 6, // node is a statement + StrictMode = 1 << 7, // node is in the strict mode environment + PossibleOptionalParameter = 1 << 8, + ClassBaseConstructorCall = 1 << 9, + OptionalName = 1 << 10, + // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. + // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. + // Once we have a better way to associate information with nodes, this flag should not be used. + SkipNextRParen = 1 << 11, + } + + export enum DeclFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + } + + export enum ModuleFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + IsEnum = 1 << 8, + ShouldEmitModuleDecl = 1 << 9, + IsWholeFile = 1 << 10, + IsDynamic = 1 << 11, + MustCaptureThis = 1 << 12, + } + + export enum SymbolFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + Property = 1 << 8, + Readonly = 1 << 9, + ModuleMember = 1 << 10, + InterfaceMember = 1 << 11, + ClassMember = 1 << 12, + BuiltIn = 1 << 13, + TypeSetDuringScopeAssignment = 1 << 14, + Constant = 1 << 15, + Optional = 1 << 16, + RecursivelyReferenced = 1 << 17, + Bound = 1 << 18, + CompilerGenerated = 1 << 19, + } + + export enum VarFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + AutoInit = 1 << 8, + Property = 1 << 9, + Readonly = 1 << 10, + Class = 1 << 11, + ClassProperty = 1 << 12, + ClassBodyProperty = 1 << 13, + ClassConstructorProperty = 1 << 14, + ClassSuperMustBeFirstCallInConstructor = 1 << 15, + Constant = 1 << 16, + MustCaptureThis = 1 << 17, + } + + export enum FncFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + Definition = 1 << 8, + Signature = 1 << 9, + Method = 1 << 10, + HasReturnExpression = 1 << 11, + CallMember = 1 << 12, + ConstructMember = 1 << 13, + HasSelfReference = 1 << 14, + IsFatArrowFunction = 1 << 15, + IndexerMember = 1 << 16, + IsFunctionExpression = 1 << 17, + ClassMethod = 1 << 18, + ClassPropertyMethodExported = 1 << 19, + } + + export enum SignatureFlags { + None = 0, + IsIndexer = 1, + IsStringIndexer = 1 << 1, + IsNumberIndexer = 1 << 2, + } + + export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; + export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; + export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; + export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; + export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { + return fncOrVarOrSymbolOrModuleFlags; + } + + export enum TypeFlags { + None = 0, + HasImplementation = 1, + HasSelfReference = 1 << 1, + MergeResult = 1 << 2, + IsEnum = 1 << 3, + BuildingName = 1 << 4, + HasBaseType = 1 << 5, + HasBaseTypeOfObject = 1 << 6, + IsClass = 1 << 7, + } + + export enum TypeRelationshipFlags { + SuccessfulComparison = 0, + SourceIsNullTargetIsVoidOrUndefined = 1, + RequiredPropertyIsMissing = 1 << 1, + IncompatibleSignatures = 1 << 2, + SourceSignatureHasTooManyParameters = 3, + IncompatibleReturnTypes = 1 << 4, + IncompatiblePropertyTypes = 1 << 5, + IncompatibleParameterTypes = 1 << 6, + } + + export enum CodeGenTarget { + ES3 = 0, + ES5 = 1, + } + + export enum ModuleGenTarget { + Synchronous = 0, + Asynchronous = 1, + Local = 1 << 1, + } + + // Compiler defaults to generating ES5-compliant code for + // - getters and setters + export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; + + export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; + + export var optimizeModuleCodeGen = true; + + export function flagsToString(e, flags: number): string { + var builder = ""; + for (var i = 1; i < (1 << 31) ; i = i << 1) { + if ((flags & i) != 0) { + for (var k in e) { + if (e[k] == i) { + if (builder.length > 0) { + builder += "|"; + } + builder += k; + break; + } + } + } + } + return builder; + } + + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff deleted file mode 100644 index 1474c69126..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff +++ /dev/null @@ -1,281 +0,0 @@ ---- old.parserRealSource2.errors.txt -+++ new.parserRealSource2.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource2.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- -- export function hasFlag(val: number, flag: number) { -- return (val & flag) != 0; -- } -- -- export enum ErrorRecoverySet { -- None = 0, -- Comma = 1, // Comma -- SColon = 1 << 1, // SColon -- Asg = 1 << 2, // Asg -- BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv -- // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, -- // Pct, GT, LT, And, Xor, Or -- RBrack = 1 << 4, // RBrack -- RCurly = 1 << 5, // RCurly -- RParen = 1 << 6, // RParen -- Dot = 1 << 7, // Dot -- Colon = 1 << 8, // Colon -- PrimType = 1 << 9, // number, string, boolean -- AddOp = 1 << 10, // Add, Sub -- LCurly = 1 << 11, // LCurly -- PreOp = 1 << 12, // Tilde, Bang, Inc, Dec -- RegExp = 1 << 13, // RegExp -- LParen = 1 << 14, // LParen -- LBrack = 1 << 15, // LBrack -- Scope = 1 << 16, // Scope -- In = 1 << 17, // IN -- SCase = 1 << 18, // CASE, DEFAULT -- Else = 1 << 19, // ELSE -- Catch = 1 << 20, // CATCH, FINALLY -- Var = 1 << 21, // -- Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH -- While = 1 << 23, // WHILE -- ID = 1 << 24, // ID -- Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT -- Literal = 1 << 26, // IntCon, FltCon, StrCon -- RLit = 1 << 27, // THIS, TRUE, FALSE, NULL -- Func = 1 << 28, // FUNCTION -- EOF = 1 << 29, // EOF -- -- // REVIEW: Name this something clearer. -- TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT -- ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, -- StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, -- Postfix = Dot | LParen | LBrack, -- } -- -- export enum AllowedElements { -- None = 0, -- ModuleDeclarations = 1 << 2, -- ClassDeclarations = 1 << 3, -- InterfaceDeclarations = 1 << 4, -- AmbientDeclarations = 1 << 10, -- Properties = 1 << 11, -- -- Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, -- QuickParse = Global | Properties, -- } -- -- export enum Modifiers { -- None = 0, -- Private = 1, -- Public = 1 << 1, -- Readonly = 1 << 2, -- Ambient = 1 << 3, -- Exported = 1 << 4, -- Getter = 1 << 5, -- Setter = 1 << 6, -- Static = 1 << 7, -- } -- -- export enum ASTFlags { -- None = 0, -- ExplicitSemicolon = 1, // statment terminated by an explicit semicolon -- AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon -- Writeable = 1 << 2, // node is lhs that can be modified -- Error = 1 << 3, // node has an error -- DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor -- DotLHS = 1 << 5, // node is the lhs of a dot expr -- IsStatement = 1 << 6, // node is a statement -- StrictMode = 1 << 7, // node is in the strict mode environment -- PossibleOptionalParameter = 1 << 8, -- ClassBaseConstructorCall = 1 << 9, -- OptionalName = 1 << 10, -- // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. -- // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. -- // Once we have a better way to associate information with nodes, this flag should not be used. -- SkipNextRParen = 1 << 11, -- } -- -- export enum DeclFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- } -- -- export enum ModuleFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- IsEnum = 1 << 8, -- ShouldEmitModuleDecl = 1 << 9, -- IsWholeFile = 1 << 10, -- IsDynamic = 1 << 11, -- MustCaptureThis = 1 << 12, -- } -- -- export enum SymbolFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- Property = 1 << 8, -- Readonly = 1 << 9, -- ModuleMember = 1 << 10, -- InterfaceMember = 1 << 11, -- ClassMember = 1 << 12, -- BuiltIn = 1 << 13, -- TypeSetDuringScopeAssignment = 1 << 14, -- Constant = 1 << 15, -- Optional = 1 << 16, -- RecursivelyReferenced = 1 << 17, -- Bound = 1 << 18, -- CompilerGenerated = 1 << 19, -- } -- -- export enum VarFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- AutoInit = 1 << 8, -- Property = 1 << 9, -- Readonly = 1 << 10, -- Class = 1 << 11, -- ClassProperty = 1 << 12, -- ClassBodyProperty = 1 << 13, -- ClassConstructorProperty = 1 << 14, -- ClassSuperMustBeFirstCallInConstructor = 1 << 15, -- Constant = 1 << 16, -- MustCaptureThis = 1 << 17, -- } -- -- export enum FncFlags { -- None = 0, -- Exported = 1, -- Private = 1 << 1, -- Public = 1 << 2, -- Ambient = 1 << 3, -- Static = 1 << 4, -- LocalStatic = 1 << 5, -- GetAccessor = 1 << 6, -- SetAccessor = 1 << 7, -- Definition = 1 << 8, -- Signature = 1 << 9, -- Method = 1 << 10, -- HasReturnExpression = 1 << 11, -- CallMember = 1 << 12, -- ConstructMember = 1 << 13, -- HasSelfReference = 1 << 14, -- IsFatArrowFunction = 1 << 15, -- IndexerMember = 1 << 16, -- IsFunctionExpression = 1 << 17, -- ClassMethod = 1 << 18, -- ClassPropertyMethodExported = 1 << 19, -- } -- -- export enum SignatureFlags { -- None = 0, -- IsIndexer = 1, -- IsStringIndexer = 1 << 1, -- IsNumberIndexer = 1 << 2, -- } -- -- export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; -- export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; -- export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; -- export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; -- export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { -- return fncOrVarOrSymbolOrModuleFlags; -- } -- -- export enum TypeFlags { -- None = 0, -- HasImplementation = 1, -- HasSelfReference = 1 << 1, -- MergeResult = 1 << 2, -- IsEnum = 1 << 3, -- BuildingName = 1 << 4, -- HasBaseType = 1 << 5, -- HasBaseTypeOfObject = 1 << 6, -- IsClass = 1 << 7, -- } -- -- export enum TypeRelationshipFlags { -- SuccessfulComparison = 0, -- SourceIsNullTargetIsVoidOrUndefined = 1, -- RequiredPropertyIsMissing = 1 << 1, -- IncompatibleSignatures = 1 << 2, -- SourceSignatureHasTooManyParameters = 3, -- IncompatibleReturnTypes = 1 << 4, -- IncompatiblePropertyTypes = 1 << 5, -- IncompatibleParameterTypes = 1 << 6, -- } -- -- export enum CodeGenTarget { -- ES3 = 0, -- ES5 = 1, -- } -- -- export enum ModuleGenTarget { -- Synchronous = 0, -- Asynchronous = 1, -- Local = 1 << 1, -- } -- -- // Compiler defaults to generating ES5-compliant code for -- // - getters and setters -- export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; -- -- export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; -- -- export var optimizeModuleCodeGen = true; -- -- export function flagsToString(e, flags: number): string { -- var builder = ""; -- for (var i = 1; i < (1 << 31) ; i = i << 1) { -- if ((flags & i) != 0) { -- for (var k in e) { -- if (e[k] == i) { -- if (builder.length > 0) { -- builder += "|"; -- } -- builder += k; -- break; -- } -- } -- } -- } -- return builder; -- } -- -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt new file mode 100644 index 0000000000..ad9c1f9ac6 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt @@ -0,0 +1,125 @@ +parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource3.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback + export enum NodeType { + None, + Empty, + EmptyExpr, + True, + False, + This, + Super, + QString, + Regex, + Null, + ArrayLit, + ObjectLit, + Void, + Comma, + Pos, + Neg, + Delete, + Await, + In, + Dot, + From, + Is, + InstOf, + Typeof, + NumberLit, + Name, + TypeRef, + Index, + Call, + New, + Asg, + AsgAdd, + AsgSub, + AsgDiv, + AsgMul, + AsgMod, + AsgAnd, + AsgXor, + AsgOr, + AsgLsh, + AsgRsh, + AsgRs2, + ConditionalExpression, + LogOr, + LogAnd, + Or, + Xor, + And, + Eq, + Ne, + Eqv, + NEqv, + Lt, + Le, + Gt, + Ge, + Add, + Sub, + Mul, + Div, + Mod, + Lsh, + Rsh, + Rs2, + Not, + LogNot, + IncPre, + DecPre, + IncPost, + DecPost, + TypeAssertion, + FuncDecl, + Member, + VarDecl, + ArgDecl, + Return, + Break, + Continue, + Throw, + For, + ForIn, + If, + While, + DoWhile, + Block, + Case, + Switch, + Try, + TryCatch, + TryFinally, + Finally, + Catch, + List, + Script, + ClassDeclaration, + InterfaceDeclaration, + ModuleDeclaration, + ImportDeclaration, + With, + Label, + LabeledStatement, + EBStart, + GotoEB, + EndCode, + Error, + Comment, + Debugger, + GeneralNode = FuncDecl, + LastAsg = AsgRs2, + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff deleted file mode 100644 index abd13c93f3..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff +++ /dev/null @@ -1,129 +0,0 @@ ---- old.parserRealSource3.errors.txt -+++ new.parserRealSource3.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. -- -- --==== parserRealSource3.ts (1 errors) ==== -- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. -- // See LICENSE.txt in the project root for complete license information. -- -- /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. -- -- module TypeScript { -- // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback -- export enum NodeType { -- None, -- Empty, -- EmptyExpr, -- True, -- False, -- This, -- Super, -- QString, -- Regex, -- Null, -- ArrayLit, -- ObjectLit, -- Void, -- Comma, -- Pos, -- Neg, -- Delete, -- Await, -- In, -- Dot, -- From, -- Is, -- InstOf, -- Typeof, -- NumberLit, -- Name, -- TypeRef, -- Index, -- Call, -- New, -- Asg, -- AsgAdd, -- AsgSub, -- AsgDiv, -- AsgMul, -- AsgMod, -- AsgAnd, -- AsgXor, -- AsgOr, -- AsgLsh, -- AsgRsh, -- AsgRs2, -- ConditionalExpression, -- LogOr, -- LogAnd, -- Or, -- Xor, -- And, -- Eq, -- Ne, -- Eqv, -- NEqv, -- Lt, -- Le, -- Gt, -- Ge, -- Add, -- Sub, -- Mul, -- Div, -- Mod, -- Lsh, -- Rsh, -- Rs2, -- Not, -- LogNot, -- IncPre, -- DecPre, -- IncPost, -- DecPost, -- TypeAssertion, -- FuncDecl, -- Member, -- VarDecl, -- ArgDecl, -- Return, -- Break, -- Continue, -- Throw, -- For, -- ForIn, -- If, -- While, -- DoWhile, -- Block, -- Case, -- Switch, -- Try, -- TryCatch, -- TryFinally, -- Finally, -- Catch, -- List, -- Script, -- ClassDeclaration, -- InterfaceDeclaration, -- ModuleDeclaration, -- ImportDeclaration, -- With, -- Label, -- LabeledStatement, -- EBStart, -- GotoEB, -- EndCode, -- Error, -- Comment, -- Debugger, -- GeneralNode = FuncDecl, -- LastAsg = AsgRs2, -- } -- } -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt index f3bf960e1d..d20b223402 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt @@ -1,11 +1,14 @@ +parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. -==== parserRealSource4.ts (1 errors) ==== +==== parserRealSource4.ts (2 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff deleted file mode 100644 index a20c55edde..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff +++ /dev/null @@ -1,18 +0,0 @@ ---- old.parserRealSource4.errors.txt -+++ new.parserRealSource4.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. - - --==== parserRealSource4.ts (2 errors) ==== -+==== parserRealSource4.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt index 8e13f7af9d..9166edb4e6 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt @@ -1,3 +1,4 @@ +parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. @@ -8,11 +9,13 @@ parserRealSource5.ts(61,52): error TS2304: Cannot find name 'AST'. parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. -==== parserRealSource5.ts (8 errors) ==== +==== parserRealSource5.ts (9 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { // TODO: refactor indent logic for use in emit diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff deleted file mode 100644 index 5c7ec99caf..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff +++ /dev/null @@ -1,22 +0,0 @@ ---- old.parserRealSource5.errors.txt -+++ new.parserRealSource5.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. - parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. - parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. -@@= skipped -8, +7 lines =@@ - parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. - - --==== parserRealSource5.ts (9 errors) ==== -+==== parserRealSource5.ts (8 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - // TODO: refactor indent logic for use in emit \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt index 6d21559554..0c55b63b07 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt @@ -1,3 +1,4 @@ +parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. @@ -59,11 +60,13 @@ parserRealSource6.ts(212,81): error TS2304: Cannot find name 'ISourceText'. parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource6.ts (59 errors) ==== +==== parserRealSource6.ts (60 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class TypeCollectionContext { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff index 56c1619149..f7b30ecddc 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource6.errors.txt +++ new.parserRealSource6.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. - parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. - parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. -@@= skipped -11, +10 lines =@@ +@@= skipped -11, +11 lines =@@ parserRealSource6.ts(27,48): error TS2304: Cannot find name 'SymbolScope'. parserRealSource6.ts(28,31): error TS2304: Cannot find name 'AST'. parserRealSource6.ts(30,35): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -23,22 +18,7 @@ parserRealSource6.ts(142,22): error TS2304: Cannot find name 'NodeType'. parserRealSource6.ts(143,38): error TS2304: Cannot find name 'UnaryExpression'. parserRealSource6.ts(156,22): error TS2304: Cannot find name 'NodeType'. -@@= skipped -16, +16 lines =@@ - parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. - - --==== parserRealSource6.ts (60 errors) ==== -+==== parserRealSource6.ts (59 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export class TypeCollectionContext { -@@= skipped -61, +59 lines =@@ +@@= skipped -77, +77 lines =@@ !!! error TS2304: Cannot find name 'ModuleDeclaration'. public enclosingClassDecl: TypeDeclaration = null; ~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt index 9103a77c23..e91833fac9 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt @@ -1,3 +1,4 @@ +parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? @@ -303,11 +304,13 @@ parserRealSource7.ts(827,34): error TS2304: Cannot find name 'NodeType'. parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. -==== parserRealSource7.ts (303 errors) ==== +==== parserRealSource7.ts (304 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Continuation { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff index beb218b82b..0b6378c5c9 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource7.errors.txt +++ new.parserRealSource7.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. - parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. - parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? -@@= skipped -10, +9 lines =@@ +@@= skipped -10, +10 lines =@@ parserRealSource7.ts(34,68): error TS2304: Cannot find name 'TypeCollectionContext'. parserRealSource7.ts(35,25): error TS2304: Cannot find name 'ValueLocation'. parserRealSource7.ts(36,30): error TS2304: Cannot find name 'TypeLink'. @@ -93,22 +88,7 @@ parserRealSource7.ts(535,53): error TS2304: Cannot find name 'VarFlags'. parserRealSource7.ts(535,75): error TS2304: Cannot find name 'VarFlags'. parserRealSource7.ts(539,38): error TS2304: Cannot find name 'SymbolFlags'. -@@= skipped -86, +86 lines =@@ - parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. - - --==== parserRealSource7.ts (304 errors) ==== -+==== parserRealSource7.ts (303 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export class Continuation { -@@= skipped -72, +70 lines =@@ +@@= skipped -158, +158 lines =@@ var fieldSymbol = new FieldSymbol("prototype", ast.minChar, ~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt index 359492c310..56c4a714dc 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt @@ -1,3 +1,4 @@ +parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -129,11 +130,13 @@ parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? -==== parserRealSource8.ts (129 errors) ==== +==== parserRealSource8.ts (130 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff index c6ad58808b..b10455680c 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource8.errors.txt +++ new.parserRealSource8.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. - parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. - parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. -@@= skipped -39, +38 lines =@@ +@@= skipped -39, +39 lines =@@ parserRealSource8.ts(160,76): error TS2304: Cannot find name 'StringHashTable'. parserRealSource8.ts(160,99): error TS2304: Cannot find name 'StringHashTable'. parserRealSource8.ts(162,28): error TS2304: Cannot find name 'Type'. @@ -35,23 +30,11 @@ parserRealSource8.ts(449,76): error TS2304: Cannot find name 'FncFlags'. parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. -parserRealSource8.ts(454,35): error TS2304: Cannot find name 'Catch'. -- -- --==== parserRealSource8.ts (130 errors) ==== +parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? -+ -+ -+==== parserRealSource8.ts (129 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - -@@= skipped -252, +250 lines =@@ + + + ==== parserRealSource8.ts (130 errors) ==== +@@= skipped -252, +252 lines =@@ !!! error TS2304: Cannot find name 'Type'. var withSymbol = new WithSymbol(withStmt.minChar, context.typeFlow.checker.locationInfo.unitIndex, withType); ~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt index dffb11e04a..9fd2058cb8 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt @@ -1,3 +1,4 @@ +parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -38,11 +39,13 @@ parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -==== parserRealSource9.ts (38 errors) ==== +==== parserRealSource9.ts (39 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Binder { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff index ec66794d0e..7126ae5383 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserRealSource9.errors.txt +++ new.parserRealSource9.errors.txt -@@= skipped -0, +0 lines =@@ --parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. - parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. - parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. - parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. -@@= skipped -9, +8 lines =@@ +@@= skipped -9, +9 lines =@@ parserRealSource9.ts(67,54): error TS2304: Cannot find name 'SignatureGroup'. parserRealSource9.ts(67,77): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(67,104): error TS2304: Cannot find name 'Type'. @@ -23,20 +18,7 @@ parserRealSource9.ts(197,20): error TS2339: Property 'bound' does not exist on type 'Symbol'. parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. - - --==== parserRealSource9.ts (39 errors) ==== -+==== parserRealSource9.ts (38 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export class Binder { -@@= skipped -115, +113 lines =@@ +@@= skipped -115, +115 lines =@@ // check that last parameter has an array type var lastParam = signature.parameters[paramLen - 1]; ~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt index 31a75354a8..a476f8e9cd 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt @@ -1,3 +1,7 @@ +parserharness.ts(16,21): error TS6053: File '/compiler/io.ts' not found. +parserharness.ts(17,21): error TS6053: File '/compiler/typescript.ts' not found. +parserharness.ts(18,21): error TS6053: File '/services/typescriptServices.ts' not found. +parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. @@ -106,7 +110,7 @@ parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? -==== parserharness.ts (106 errors) ==== +==== parserharness.ts (110 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -123,9 +127,17 @@ parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean ' // /// + ~~~~~~~~~~~~~~~~~ +!!! error TS6053: File '/compiler/io.ts' not found. /// + ~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File '/compiler/typescript.ts' not found. /// + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File '/services/typescriptServices.ts' not found. /// + ~~~~~~~ +!!! error TS6053: File 'diff.ts' not found. declare var assert: Harness.Assert; ~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff index e36a9f9461..989c52bd3a 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff @@ -4,11 +4,13 @@ -parserharness.ts(16,21): error TS6053: File '../compiler/io.ts' not found. -parserharness.ts(17,21): error TS6053: File '../compiler/typescript.ts' not found. -parserharness.ts(18,21): error TS6053: File '../services/typescriptServices.ts' not found. --parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. ++parserharness.ts(16,21): error TS6053: File '/compiler/io.ts' not found. ++parserharness.ts(17,21): error TS6053: File '/compiler/typescript.ts' not found. ++parserharness.ts(18,21): error TS6053: File '/services/typescriptServices.ts' not found. + parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. - parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. -@@= skipped -17, +13 lines =@@ +@@= skipped -17, +17 lines =@@ parserharness.ts(724,29): error TS2304: Cannot find name 'ITextWriter'. parserharness.ts(754,53): error TS2552: Cannot find name 'TypeScript'. Did you mean 'TypeScriptLS'? parserharness.ts(764,56): error TS2503: Cannot find namespace 'TypeScript'. @@ -141,35 +143,28 @@ parserharness.ts(1787,38): error TS2503: Cannot find namespace 'Services'. parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. -parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. -- -- --==== parserharness.ts (110 errors) ==== +parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? -+ -+ -+==== parserharness.ts (106 errors) ==== - // - // Copyright (c) Microsoft Corporation. All rights reserved. - // -@@= skipped -20, +20 lines =@@ - // + + + ==== parserharness.ts (110 errors) ==== +@@= skipped -21, +21 lines =@@ /// -- ~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../compiler/io.ts' not found. ++!!! error TS6053: File '/compiler/io.ts' not found. /// -- ~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../compiler/typescript.ts' not found. ++!!! error TS6053: File '/compiler/typescript.ts' not found. /// -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../services/typescriptServices.ts' not found. ++!!! error TS6053: File '/services/typescriptServices.ts' not found. /// -- ~~~~~~~ --!!! error TS6053: File 'diff.ts' not found. - - declare var assert: Harness.Assert; - ~~~~~~~~~~~~~~ -@@= skipped -790, +782 lines =@@ + ~~~~~~~ + !!! error TS6053: File 'diff.ts' not found. +@@= skipped -789, +789 lines =@@ !!! error TS2503: Cannot find namespace 'TypeScript'. var compiler = c || new TypeScript.TypeScriptCompiler(stderr); ~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt index c3eb8c504f..ecef6e2a1d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt @@ -1,3 +1,4 @@ +parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -127,7 +128,7 @@ parserindenter.ts(735,42): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. -==== parserindenter.ts (127 errors) ==== +==== parserindenter.ts (128 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -144,6 +145,8 @@ parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. // /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'formatting.ts' not found. module Formatting { diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff index 1497927902..01e624fb02 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff @@ -1,11 +1,6 @@ --- old.parserindenter.errors.txt +++ new.parserindenter.errors.txt -@@= skipped -0, +0 lines =@@ --parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. - parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. - parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. - parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. -@@= skipped -10, +9 lines =@@ +@@= skipped -10, +10 lines =@@ parserindenter.ts(37,48): error TS2304: Cannot find name 'Dictionary_int_int'. parserindenter.ts(47,43): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(47,65): error TS2304: Cannot find name 'TokenSpan'. @@ -94,25 +89,7 @@ parserindenter.ts(717,22): error TS2304: Cannot find name 'AuthorTokenKind'. parserindenter.ts(718,73): error TS2304: Cannot find name 'AuthorParseNodeKind'. parserindenter.ts(721,22): error TS2304: Cannot find name 'AuthorTokenKind'. -@@= skipped -23, +23 lines =@@ - parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. - - --==== parserindenter.ts (128 errors) ==== -+==== parserindenter.ts (127 errors) ==== - // - // Copyright (c) Microsoft Corporation. All rights reserved. - // -@@= skipped -17, +17 lines =@@ - // - - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'formatting.ts' not found. - - - module Formatting { -@@= skipped -58, +56 lines =@@ +@@= skipped -98, +98 lines =@@ ~~~~~~~~~ !!! error TS2304: Cannot find name 'TokenSpan'. ~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt index ca1c2ae9a6..833098432b 100644 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt @@ -1,3 +1,4 @@ +scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? @@ -15,8 +16,10 @@ scannertest1.ts(19,23): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. -==== scannertest1.ts (15 errors) ==== +==== scannertest1.ts (16 errors) ==== /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'References.ts' not found. class CharacterInfo { public static isDecimalDigit(c: number): boolean { diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff deleted file mode 100644 index 2d8965d4df..0000000000 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff +++ /dev/null @@ -1,19 +0,0 @@ ---- old.scannertest1.errors.txt -+++ new.scannertest1.errors.txt -@@= skipped -0, +0 lines =@@ --scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. - scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. - scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. - scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? -@@= skipped -15, +14 lines =@@ - scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. - - --==== scannertest1.ts (16 errors) ==== -+==== scannertest1.ts (15 errors) ==== - /// -- ~~~~~~~~~~~~~ --!!! error TS6053: File 'References.ts' not found. - - class CharacterInfo { - public static isDecimalDigit(c: number): boolean { \ No newline at end of file diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js index 69a3eed6d1..39e35c60f4 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -66,6 +66,7 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. [HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt [HH:MM:SS AM] Building project 'logic/tsconfig.json'... @@ -85,7 +86,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~ -Found 2 errors in 2 files. +Found 3 errors in 2 files. Errors Files 1 logic/index.ts:5 @@ -130,10 +131,11 @@ function leftPad(s, n) { return s + n; } function multiply(a, b) { return a * b; } //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -191,8 +193,13 @@ function multiply(a, b) { return a * b; } "options": { "composite": true }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./index.ts", + "./some_decl.d.ts" + ], "latestChangedDtsFile": "./index.d.ts", - "size": 1539 + "size": 1590 } //// [/user/username/projects/sample1/logic/index.d.ts] *new* export declare function getSecondsInDay(): number; @@ -467,9 +474,9 @@ exports.m = mod; core/tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /user/username/projects/sample1/core/index.ts -*refresh* /user/username/projects/sample1/core/some_decl.d.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/sample1/core/index.ts +*not cached* /user/username/projects/sample1/core/some_decl.d.ts Signatures:: (stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js index d546837a27..91f397d078 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -66,6 +66,7 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... +error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. [HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'logic/tsconfig.json'... @@ -85,7 +86,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~ -Found 2 errors in 2 files. +Found 3 errors in 2 files. Errors Files 1 logic/index.ts:5 @@ -130,10 +131,11 @@ function leftPad(s, n) { return s + n; } function multiply(a, b) { return a * b; } //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -191,8 +193,13 @@ function multiply(a, b) { return a * b; } "options": { "composite": true }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./index.ts", + "./some_decl.d.ts" + ], "latestChangedDtsFile": "./index.d.ts", - "size": 1539 + "size": 1590 } //// [/user/username/projects/sample1/logic/index.d.ts] *new* export declare function getSecondsInDay(): number; @@ -467,9 +474,9 @@ exports.m = mod; core/tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /user/username/projects/sample1/core/index.ts -*refresh* /user/username/projects/sample1/core/some_decl.d.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /user/username/projects/sample1/core/index.ts +*not cached* /user/username/projects/sample1/core/some_decl.d.ts Signatures:: (stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js index b7c372258f..b3c39771d5 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js @@ -3,8 +3,12 @@ useCaseSensitiveFileNames::true Input:: tsgo --moduleResolution nodenext first.ts --module nodenext --target esnext --moduleDetection auto --jsx react --newLine crlf -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +error TS6053: File '/home/src/workspaces/project/first.ts' not found. + +Found 1 error. + //// [/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts] *Lib* /// interface Boolean {} diff --git a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js index ffe2a4f5a4..dc0b3c7da7 100644 --- a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js +++ b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js @@ -18,8 +18,16 @@ function main() { } } tsgo -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. + +2 /// +   ~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/anotherFileWithSameReferenes.ts:2 + //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -66,10 +74,11 @@ declare function main(): void; function main() { } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -162,16 +171,22 @@ function main() { } "./src/fileNotFound.ts" ] }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1910 + "size": 1963 } tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /home/src/workspaces/project/src/filePresent.ts -*refresh* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*refresh* /home/src/workspaces/project/src/main.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/src/filePresent.ts +*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*not cached* /home/src/workspaces/project/src/main.ts Signatures:: (stored at emit) /home/src/workspaces/project/src/filePresent.ts (stored at emit) /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts @@ -181,11 +196,23 @@ Signatures:: Edit [0]:: no change tsgo -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. + +2 /// +   ~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/anotherFileWithSameReferenes.ts:2 + tsconfig.json:: SemanticDiagnostics:: +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/src/filePresent.ts +*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*not cached* /home/src/workspaces/project/src/main.ts Signatures:: @@ -196,8 +223,16 @@ Edit [1]:: Modify main file function main() { }something(); tsgo -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. + +2 /// +   ~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/anotherFileWithSameReferenes.ts:2 + //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -205,10 +240,11 @@ function main() { } something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -301,13 +337,22 @@ something(); "./src/fileNotFound.ts" ] }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1922 + "size": 1975 } tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/workspaces/project/src/main.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/src/filePresent.ts +*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*not cached* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -319,8 +364,16 @@ Edit [2]:: Modify main file again function main() { }something();something(); tsgo -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. + +2 /// +   ~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/anotherFileWithSameReferenes.ts:2 + //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -329,10 +382,11 @@ something(); something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -425,13 +479,22 @@ something(); "./src/fileNotFound.ts" ] }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/main.ts" + ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1934 + "size": 1987 } tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/workspaces/project/src/main.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/src/filePresent.ts +*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*not cached* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -446,8 +509,16 @@ function main() { }something();something();foo(); function foo() { return 20; } tsgo -ExitStatus:: Success +ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. + +2 /// +   ~~~~~~~~~~~~~~~~~ + + +Found 1 error in src/anotherFileWithSameReferenes.ts:2 + //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -464,10 +535,11 @@ declare function foo(): number; function foo() { return 20; } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"latestChangedDtsFile":"./src/newFile.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[[2,5]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5],"latestChangedDtsFile":"./src/newFile.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -581,15 +653,24 @@ function foo() { return 20; } "./src/fileNotFound.ts" ] }, + "semanticDiagnosticsPerFile": [ + "lib.d.ts", + "./src/filePresent.ts", + "./src/anotherFileWithSameReferenes.ts", + "./src/newFile.ts", + "./src/main.ts" + ], "latestChangedDtsFile": "./src/newFile.d.ts", - "size": 2216 + "size": 2271 } tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /home/src/workspaces/project/src/newFile.ts -*refresh* /home/src/workspaces/project/src/main.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/src/filePresent.ts +*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*not cached* /home/src/workspaces/project/src/newFile.ts +*not cached* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/newFile.ts (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -749,8 +830,10 @@ function something2() { return 20; } tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/filePresent.ts *refresh* /home/src/workspaces/project/src/fileNotFound.ts *refresh* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*refresh* /home/src/workspaces/project/src/newFile.ts *refresh* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/fileNotFound.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js index afa623062e..abba0b4763 100644 --- a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js @@ -25,13 +25,22 @@ import * as mod_1 from "../primary/a"; tsgo --p reference/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +reference/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/primary/bin/a.d.ts' not found. + +1 import * as mod_1 from "../primary/a"; +  ~ + reference/tsconfig.json:7:21 - error TS6306: Referenced project '/home/src/workspaces/project/primary' must have setting "composite": true. 7 "references": [ { "path": "../primary" } ]    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error in reference/tsconfig.json:7 +Found 2 errors in 2 files. + +Errors Files + 1 reference/b.ts:1 + 1 reference/tsconfig.json:7 //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js index 8175413de0..b41868e760 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js @@ -27,10 +27,10 @@ import { m } from '@alpha/a' tsgo --p beta/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. +beta/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/alpha/bin/a.d.ts' not found. 1 import { m } from '@alpha/a' -   ~~~~~~~~~~ +  ~ Found 1 error in beta/b.ts:1 @@ -66,10 +66,11 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":28,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -112,26 +113,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); "outDir": "./" }, "semanticDiagnosticsPerFile": [ - [ - "../b.ts", - [ - { - "pos": 18, - "end": 28, - "code": 6305, - "category": 1, - "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." - } - ] - ] + "lib.d.ts", + "../b.ts" ], "latestChangedDtsFile": "./b.d.ts", - "size": 1325 + "size": 1141 } beta/tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /home/src/workspaces/project/beta/b.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/beta/b.ts Signatures:: (stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js index be88f86fa1..188a1ef1c0 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js @@ -25,10 +25,10 @@ import { m } from '../alpha/a' tsgo --p beta/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. +beta/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/alpha/bin/a.d.ts' not found. 1 import { m } from '../alpha/a' -   ~~~~~~~~~~~~ +  ~ Found 1 error in beta/b.ts:1 @@ -64,10 +64,11 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":30,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", + "errors": true, "root": [ { "files": [ @@ -110,26 +111,16 @@ Object.defineProperty(exports, "__esModule", { value: true }); "outDir": "./" }, "semanticDiagnosticsPerFile": [ - [ - "../b.ts", - [ - { - "pos": 18, - "end": 30, - "code": 6305, - "category": 1, - "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." - } - ] - ] + "lib.d.ts", + "../b.ts" ], "latestChangedDtsFile": "./b.d.ts", - "size": 1327 + "size": 1143 } beta/tsconfig.json:: SemanticDiagnostics:: -*refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /home/src/workspaces/project/beta/b.ts +*not cached* /home/src/tslibs/TS/Lib/lib.d.ts +*not cached* /home/src/workspaces/project/beta/b.ts Signatures:: (stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js b/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js index b7ebae5101..508fa2d280 100644 --- a/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js +++ b/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js @@ -21,10 +21,10 @@ export const x = 10; tsgo --p project ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -project/index.ts:1:19 - error TS6305: Output file '/home/src/workspaces/solution/utils/index.d.ts' has not been built from source file '/home/src/workspaces/solution/utils/index.ts'. +project/index.ts:1:1 - error TS6053: File '/home/src/workspaces/solution/utils/index.d.ts' not found. 1 import { x } from "../utils"; -   ~~~~~~~~~~ +  ~ Found 1 error in project/index.ts:1 diff --git a/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js b/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js index 38e6f71d13..514822a22e 100644 --- a/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js +++ b/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js @@ -22,13 +22,22 @@ export const x = 10; tsgo --p project ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: +project/index.ts:1:1 - error TS6053: File '/home/src/workspaces/solution/utils/index.d.ts' not found. + +1 import { x } from "../utils"; +  ~ + project/tsconfig.json:3:9 - error TS6310: Referenced project '/home/src/workspaces/solution/utils' may not disable emit. 3 { "path": "../utils" },    ~~~~~~~~~~~~~~~~~~~~~~ -Found 1 error in project/tsconfig.json:3 +Found 2 errors in 2 files. + +Errors Files + 1 project/index.ts:1 + 1 project/tsconfig.json:3 //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// From 1999a76dd24bdefc73fc38086346e64f2c1c7160 Mon Sep 17 00:00:00 2001 From: han Date: Wed, 19 Nov 2025 22:31:18 +0000 Subject: [PATCH 13/22] Revert "update new baseline" This reverts commit eadc7bf990d80249ead10559ce5b2be0369ee9d3. --- internal/compiler/program.go | 30 +- ...declarationEmitInvalidReference.errors.txt | 8 - ...rationEmitInvalidReference.errors.txt.diff | 12 - ...eclarationEmitInvalidReference2.errors.txt | 8 - ...ationEmitInvalidReference2.errors.txt.diff | 12 + ...tionEmitInvalidReferenceAllowJs.errors.txt | 9 - ...mitInvalidReferenceAllowJs.errors.txt.diff | 17 +- ...uplicateIdentifierRelatedSpans6.errors.txt | 11 +- ...ateIdentifierRelatedSpans6.errors.txt.diff | 11 +- ...uplicateIdentifierRelatedSpans7.errors.txt | 11 +- ...ateIdentifierRelatedSpans7.errors.txt.diff | 20 +- .../fileReferencesWithNoExtensions.errors.txt | 31 -- ...ReferencesWithNoExtensions.errors.txt.diff | 35 --- .../invalidTripleSlashReference.errors.txt | 14 - ...nvalidTripleSlashReference.errors.txt.diff | 18 ++ ...tionDuringSyntheticDefaultCheck.errors.txt | 38 --- ...uringSyntheticDefaultCheck.errors.txt.diff | 42 --- .../compiler/selfReferencingFile2.errors.txt | 11 - .../selfReferencingFile2.errors.txt.diff | 20 +- .../conformance/parserRealSource1.errors.txt | 160 ---------- .../parserRealSource1.errors.txt.diff | 164 ++++++++++ .../conformance/parserRealSource10.errors.txt | 5 +- .../parserRealSource10.errors.txt.diff | 22 ++ .../conformance/parserRealSource11.errors.txt | 5 +- .../parserRealSource11.errors.txt.diff | 24 +- .../conformance/parserRealSource12.errors.txt | 5 +- .../parserRealSource12.errors.txt.diff | 24 +- .../conformance/parserRealSource13.errors.txt | 5 +- .../parserRealSource13.errors.txt.diff | 27 +- .../conformance/parserRealSource14.errors.txt | 5 +- .../parserRealSource14.errors.txt.diff | 22 ++ .../conformance/parserRealSource2.errors.txt | 277 ----------------- .../parserRealSource2.errors.txt.diff | 281 ++++++++++++++++++ .../conformance/parserRealSource3.errors.txt | 125 -------- .../parserRealSource3.errors.txt.diff | 129 ++++++++ .../conformance/parserRealSource4.errors.txt | 5 +- .../parserRealSource4.errors.txt.diff | 18 ++ .../conformance/parserRealSource5.errors.txt | 5 +- .../parserRealSource5.errors.txt.diff | 22 ++ .../conformance/parserRealSource6.errors.txt | 5 +- .../parserRealSource6.errors.txt.diff | 24 +- .../conformance/parserRealSource7.errors.txt | 5 +- .../parserRealSource7.errors.txt.diff | 24 +- .../conformance/parserRealSource8.errors.txt | 5 +- .../parserRealSource8.errors.txt.diff | 27 +- .../conformance/parserRealSource9.errors.txt | 5 +- .../parserRealSource9.errors.txt.diff | 22 +- .../conformance/parserharness.errors.txt | 14 +- .../conformance/parserharness.errors.txt.diff | 41 +-- .../conformance/parserindenter.errors.txt | 5 +- .../parserindenter.errors.txt.diff | 27 +- .../conformance/scannertest1.errors.txt | 5 +- .../conformance/scannertest1.errors.txt.diff | 19 ++ ...ror-if-input-file-is-missing-with-force.js | 19 +- .../reports-error-if-input-file-is-missing.js | 19 +- .../commandLine/Parse-enum-type-options.js | 6 +- ...le-is-added,-the-signatures-are-updated.js | 127 ++------ ...eferenced-project-doesnt-have-composite.js | 11 +- ...g-when-module-reference-is-not-relative.js | 27 +- ...ce-error-when-the-input-file-is-missing.js | 27 +- .../when-project-reference-is-not-built.js | 4 +- ...eferences-composite-project-with-noEmit.js | 11 +- 62 files changed, 1042 insertions(+), 1125 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff create mode 100644 testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 5601f72dbe..d0bccfe7e5 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1226,27 +1226,31 @@ func (p *Program) getDiagnosticsHelper(ctx context.Context, sourceFile *ast.Sour func (p *Program) addProgramDiagnostics() { for _, m := range p.missingFiles { reason := m.reason - var location core.TextRange - var parent *ast.SourceFile - var ref *ast.FileReference - - if data, ok := reason.data.(*referencedFileData); ok { - parent = p.filesByPath[data.file] - if parent != nil && data.index < len(parent.ReferencedFiles) { - ref = parent.ReferencedFiles[data.index] - location = ref.TextRange - } + data, ok := reason.data.(*referencedFileData) + if !ok { + continue + } + + parent := p.filesByPath[data.file] + if parent == nil { + continue + } + ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { + return r.FileName == m.path + }) + if ref == nil { + continue } - diag := ast.NewDiagnostic( + diagnostic := ast.NewDiagnostic( parent, - location, + ref.TextRange, diagnostics.File_0_not_found, m.path, ) - p.programDiagnostics = append(p.programDiagnostics, diag) + p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt deleted file mode 100644 index 3410b755ed..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. - - -==== declarationEmitInvalidReference.ts (1 errors) ==== - /// - ~~~~~~~~~~ -!!! error TS6053: File 'invalid.ts' not found. - var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff deleted file mode 100644 index ec4fa6df36..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt.diff +++ /dev/null @@ -1,12 +0,0 @@ ---- old.declarationEmitInvalidReference.errors.txt -+++ new.declarationEmitInvalidReference.errors.txt -@@= skipped -0, +0 lines =@@ -- -+declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. -+ -+ -+==== declarationEmitInvalidReference.ts (1 errors) ==== -+ /// -+ ~~~~~~~~~~ -+!!! error TS6053: File 'invalid.ts' not found. -+ var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt deleted file mode 100644 index ab08b44a07..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. - - -==== declarationEmitInvalidReference2.ts (1 errors) ==== - /// - ~~~~~~~~~~ -!!! error TS6053: File 'invalid.ts' not found. - var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff new file mode 100644 index 0000000000..ba50881c9f --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt.diff @@ -0,0 +1,12 @@ +--- old.declarationEmitInvalidReference2.errors.txt ++++ new.declarationEmitInvalidReference2.errors.txt +@@= skipped -0, +0 lines =@@ +-declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. +- +- +-==== declarationEmitInvalidReference2.ts (1 errors) ==== +- /// +- ~~~~~~~~~~ +-!!! error TS6053: File 'invalid.ts' not found. +- var x = 0; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt deleted file mode 100644 index 901eb88671..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. - - -==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== - /// - ~~~~~~~ -!!! error TS6053: File 'invalid' not found. - var x = 0; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff index eac8c72787..784414cf18 100644 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt.diff @@ -2,13 +2,12 @@ +++ new.declarationEmitInvalidReferenceAllowJs.errors.txt @@= skipped -0, +0 lines =@@ -declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6231: Could not resolve the path 'invalid' with the extensions: '.ts', '.tsx', '.d.ts', '.js', '.jsx', '.cts', '.d.cts', '.cjs', '.mts', '.d.mts', '.mjs'. -+declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. - - - ==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== - /// - ~~~~~~~ +- +- +-==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== +- /// +- ~~~~~~~ -!!! error TS6231: Could not resolve the path 'invalid' with the extensions: '.ts', '.tsx', '.d.ts', '.js', '.jsx', '.cts', '.d.cts', '.cjs', '.mts', '.d.mts', '.mjs'. -+!!! error TS6053: File 'invalid' not found. - var x = 0; - \ No newline at end of file +- var x = 0; +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt index 620f9be95c..6fe169252b 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt @@ -1,18 +1,11 @@ -file2.ts:1:22 - error TS6053: File 'file1' not found. - -1 /// -   ~~~~~~~ - file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" {    ~~~~~~~~~ -==== file2.ts (2 errors) ==== +==== file2.ts (1 errors) ==== /// - ~~~~~~~ -!!! error TS6053: File 'file1' not found. declare module "someMod" { ~~~~~~~~~ @@ -33,5 +26,5 @@ duplicate3: () => string; } } -Found 2 errors in the same file, starting at: file2.ts:1 +Found 1 error in file2.ts:3 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff index b00da8ee22..e6fb256ad7 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans6.errors.txt.diff @@ -58,21 +58,14 @@ - - -==== file2.ts (3 errors) ==== -+file2.ts:1:22 - error TS6053: File 'file1' not found. -+ -+1 /// -+   ~~~~~~~ -+ +file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. + +3 declare module "someMod" { +   ~~~~~~~~~ + + -+==== file2.ts (2 errors) ==== ++==== file2.ts (1 errors) ==== /// -+ ~~~~~~~ -+!!! error TS6053: File 'file1' not found. declare module "someMod" { + ~~~~~~~~~ @@ -113,7 +106,7 @@ } } -Found 6 errors in 2 files. -+Found 2 errors in the same file, starting at: file2.ts:1 ++Found 1 error in file2.ts:3 -Errors Files - 3 file1.ts:3 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt index 3f962517ec..11fcb89173 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt @@ -1,18 +1,11 @@ -file2.ts:1:22 - error TS6053: File 'file1' not found. - -1 /// -   ~~~~~~~ - file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" {    ~~~~~~~~~ -==== file2.ts (2 errors) ==== +==== file2.ts (1 errors) ==== /// - ~~~~~~~ -!!! error TS6053: File 'file1' not found. declare module "someMod" { ~~~~~~~~~ @@ -45,5 +38,5 @@ duplicate9: () => string; } } -Found 2 errors in the same file, starting at: file2.ts:1 +Found 1 error in file2.ts:3 diff --git a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff index 10d29930ae..5ea72c878c 100644 --- a/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/duplicateIdentifierRelatedSpans7.errors.txt.diff @@ -11,11 +11,6 @@ -   ~~~~~~~ - Conflicts are in this file. -file2.ts:3:1 - error TS6200: Definitions of the following identifiers conflict with those in another file: duplicate1, duplicate2, duplicate3, duplicate4, duplicate5, duplicate6, duplicate7, duplicate8, duplicate9 -+file2.ts:1:22 - error TS6053: File 'file1' not found. -+ -+1 /// -+   ~~~~~~~ -+ +file2.ts:3:16 - error TS2664: Invalid module name in augmentation, module 'someMod' cannot be found. 3 declare module "someMod" { @@ -25,16 +20,11 @@ - 1 declare module "someMod" { -   ~~~~~~~ - Conflicts are in this file. -- -- --==== file2.ts (1 errors) ==== +   ~~~~~~~~~ -+ -+ -+==== file2.ts (2 errors) ==== + + + ==== file2.ts (1 errors) ==== /// -+ ~~~~~~~ -+!!! error TS6053: File 'file1' not found. declare module "someMod" { - ~~~~~~~ @@ -45,7 +35,7 @@ export interface TopLevel { duplicate1(): number; duplicate2(): number; -@@= skipped -38, +30 lines =@@ +@@= skipped -38, +23 lines =@@ } export {}; @@ -63,7 +53,7 @@ } } -Found 2 errors in 2 files. -+Found 2 errors in the same file, starting at: file2.ts:1 ++Found 1 error in file2.ts:3 -Errors Files - 1 file1.ts:1 diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt deleted file mode 100644 index e90dfea033..0000000000 --- a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -t.ts(1,22): error TS6053: File 'a' not found. -t.ts(2,22): error TS6053: File 'b' not found. -t.ts(3,22): error TS6053: File 'c' not found. - - -==== t.ts (3 errors) ==== - /// - ~ -!!! error TS6053: File 'a' not found. - /// - ~ -!!! error TS6053: File 'b' not found. - /// - ~ -!!! error TS6053: File 'c' not found. - var a = aa; // Check that a.ts is referenced - var b = bb; // Check that b.d.ts is referenced - var c = cc; // Check that c.ts has precedence over c.d.ts - -==== a.ts (0 errors) ==== - var aa = 1; - -==== b.d.ts (0 errors) ==== - declare var bb: number; - -==== c.ts (0 errors) ==== - var cc = 1; - -==== c.d.ts (0 errors) ==== - declare var xx: number; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff deleted file mode 100644 index 6f5fce09fe..0000000000 --- a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt.diff +++ /dev/null @@ -1,35 +0,0 @@ ---- old.fileReferencesWithNoExtensions.errors.txt -+++ new.fileReferencesWithNoExtensions.errors.txt -@@= skipped -0, +0 lines =@@ -- -+t.ts(1,22): error TS6053: File 'a' not found. -+t.ts(2,22): error TS6053: File 'b' not found. -+t.ts(3,22): error TS6053: File 'c' not found. -+ -+ -+==== t.ts (3 errors) ==== -+ /// -+ ~ -+!!! error TS6053: File 'a' not found. -+ /// -+ ~ -+!!! error TS6053: File 'b' not found. -+ /// -+ ~ -+!!! error TS6053: File 'c' not found. -+ var a = aa; // Check that a.ts is referenced -+ var b = bb; // Check that b.d.ts is referenced -+ var c = cc; // Check that c.ts has precedence over c.d.ts -+ -+==== a.ts (0 errors) ==== -+ var aa = 1; -+ -+==== b.d.ts (0 errors) ==== -+ declare var bb: number; -+ -+==== c.ts (0 errors) ==== -+ var cc = 1; -+ -+==== c.d.ts (0 errors) ==== -+ declare var xx: number; -+ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt deleted file mode 100644 index ee64719ef0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. -invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. - - -==== invalidTripleSlashReference.ts (2 errors) ==== - /// - ~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'filedoesnotexist.ts' not found. - /// - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. - - // this test doesn't actually give the errors you want due to the way the compiler reports errors - var x = 1; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff new file mode 100644 index 0000000000..dda05feefc --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.invalidTripleSlashReference.errors.txt ++++ new.invalidTripleSlashReference.errors.txt +@@= skipped -0, +0 lines =@@ +-invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. +-invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. +- +- +-==== invalidTripleSlashReference.ts (2 errors) ==== +- /// +- ~~~~~~~~~~~~~~~~~~~ +-!!! error TS6053: File 'filedoesnotexist.ts' not found. +- /// +- ~~~~~~~~~~~~~~~~~~~~~~ +-!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. +- +- // this test doesn't actually give the errors you want due to the way the compiler reports errors +- var x = 1; ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt deleted file mode 100644 index 50418426f3..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt +++ /dev/null @@ -1,38 +0,0 @@ -idx.test.ts(1,22): error TS6053: File 'idx' not found. - - -==== idx.test.ts (1 errors) ==== - /// - ~~~~~ -!!! error TS6053: File 'idx' not found. - - import moment = require("moment-timezone"); - -==== node_modules/moment/index.d.ts (0 errors) ==== - declare function moment(): moment.Moment; - declare namespace moment { - interface Moment extends Object { - valueOf(): number; - } - } - export = moment; -==== node_modules/moment-timezone/index.d.ts (0 errors) ==== - import * as moment from 'moment'; - export = moment; - declare module "moment" { - interface Moment { - tz(): string; - } - } -==== idx.ts (0 errors) ==== - import * as _moment from "moment"; - declare module "moment" { - interface Moment { - strftime(pattern: string): string; - } - } - declare module "moment-timezone" { - interface Moment { - strftime(pattern: string): string; - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff deleted file mode 100644 index b4f94274de..0000000000 --- a/testdata/baselines/reference/submodule/compiler/moduleAugmentationDuringSyntheticDefaultCheck.errors.txt.diff +++ /dev/null @@ -1,42 +0,0 @@ ---- old.moduleAugmentationDuringSyntheticDefaultCheck.errors.txt -+++ new.moduleAugmentationDuringSyntheticDefaultCheck.errors.txt -@@= skipped -0, +0 lines =@@ -- -+idx.test.ts(1,22): error TS6053: File 'idx' not found. -+ -+ -+==== idx.test.ts (1 errors) ==== -+ /// -+ ~~~~~ -+!!! error TS6053: File 'idx' not found. -+ -+ import moment = require("moment-timezone"); -+ -+==== node_modules/moment/index.d.ts (0 errors) ==== -+ declare function moment(): moment.Moment; -+ declare namespace moment { -+ interface Moment extends Object { -+ valueOf(): number; -+ } -+ } -+ export = moment; -+==== node_modules/moment-timezone/index.d.ts (0 errors) ==== -+ import * as moment from 'moment'; -+ export = moment; -+ declare module "moment" { -+ interface Moment { -+ tz(): string; -+ } -+ } -+==== idx.ts (0 errors) ==== -+ import * as _moment from "moment"; -+ declare module "moment" { -+ interface Moment { -+ strftime(pattern: string): string; -+ } -+ } -+ declare module "moment-timezone" { -+ interface Moment { -+ strftime(pattern: string): string; -+ } -+ } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt deleted file mode 100644 index 4b455001c3..0000000000 --- a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt +++ /dev/null @@ -1,11 +0,0 @@ -selfReferencingFile2.ts(1,21): error TS6053: File '/selfReferencingFile2.ts' not found. - - -==== selfReferencingFile2.ts (1 errors) ==== - /// - ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '/selfReferencingFile2.ts' not found. - - class selfReferencingFile2 { - - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff index 8012bac954..4492eec599 100644 --- a/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff +++ b/testdata/baselines/reference/submodule/compiler/selfReferencingFile2.errors.txt.diff @@ -2,14 +2,14 @@ +++ new.selfReferencingFile2.errors.txt @@= skipped -0, +0 lines =@@ -selfReferencingFile2.ts(1,21): error TS6053: File '../selfReferencingFile2.ts' not found. -+selfReferencingFile2.ts(1,21): error TS6053: File '/selfReferencingFile2.ts' not found. - - - ==== selfReferencingFile2.ts (1 errors) ==== - /// - ~~~~~~~~~~~~~~~~~~~~~~~~~~ +- +- +-==== selfReferencingFile2.ts (1 errors) ==== +- /// +- ~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../selfReferencingFile2.ts' not found. -+!!! error TS6053: File '/selfReferencingFile2.ts' not found. - - class selfReferencingFile2 { - \ No newline at end of file +- +- class selfReferencingFile2 { +- +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt deleted file mode 100644 index e7d69ba104..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt +++ /dev/null @@ -1,160 +0,0 @@ -parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource1.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export module CompilerDiagnostics { - export var debug = false; - export interface IDiagnosticWriter { - Alert(output: string): void; - } - - export var diagnosticWriter: IDiagnosticWriter = null; - - export var analysisPass: number = 0; - - export function Alert(output: string) { - if (diagnosticWriter) { - diagnosticWriter.Alert(output); - } - } - - export function debugPrint(s: string) { - if (debug) { - Alert(s); - } - } - - export function assert(condition: boolean, s: string) { - if (debug) { - if (!condition) { - Alert(s); - } - } - } - - } - - export interface ILogger { - information(): boolean; - debug(): boolean; - warning(): boolean; - error(): boolean; - fatal(): boolean; - log(s: string): void; - } - - export class NullLogger implements ILogger { - public information(): boolean { return false; } - public debug(): boolean { return false; } - public warning(): boolean { return false; } - public error(): boolean { return false; } - public fatal(): boolean { return false; } - public log(s: string): void { - } - } - - export class LoggerAdapter implements ILogger { - private _information: boolean; - private _debug: boolean; - private _warning: boolean; - private _error: boolean; - private _fatal: boolean; - - constructor (public logger: ILogger) { - this._information = this.logger.information(); - this._debug = this.logger.debug(); - this._warning = this.logger.warning(); - this._error = this.logger.error(); - this._fatal = this.logger.fatal(); - } - - - public information(): boolean { return this._information; } - public debug(): boolean { return this._debug; } - public warning(): boolean { return this._warning; } - public error(): boolean { return this._error; } - public fatal(): boolean { return this._fatal; } - public log(s: string): void { - this.logger.log(s); - } - } - - export class BufferedLogger implements ILogger { - public logContents = []; - - public information(): boolean { return false; } - public debug(): boolean { return false; } - public warning(): boolean { return false; } - public error(): boolean { return false; } - public fatal(): boolean { return false; } - public log(s: string): void { - this.logContents.push(s); - } - } - - export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { - var start = +new Date(); - var result = func(); - var end = +new Date(); - logger.log(funcDescription + " completed in " + (end - start) + " msec"); - return result; - } - - export function stringToLiteral(value: string, length: number): string { - var result = ""; - - var addChar = (index: number) => { - var ch = value.charCodeAt(index); - switch (ch) { - case 0x09: // tab - result += "\\t"; - break; - case 0x0a: // line feed - result += "\\n"; - break; - case 0x0b: // vertical tab - result += "\\v"; - break; - case 0x0c: // form feed - result += "\\f"; - break; - case 0x0d: // carriage return - result += "\\r"; - break; - case 0x22: // double quote - result += "\\\""; - break; - case 0x27: // single quote - result += "\\\'"; - break; - case 0x5c: // Backslash - result += "\\"; - break; - default: - result += value.charAt(index); - } - } - - var tooLong = (value.length > length); - if (tooLong) { - var mid = length >> 1; - for (var i = 0; i < mid; i++) addChar(i); - result += "(...)"; - for (var i = value.length - mid; i < value.length; i++) addChar(i); - } - else { - length = value.length; - for (var i = 0; i < length; i++) addChar(i); - } - return result; - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff new file mode 100644 index 0000000000..e4a0e97966 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt.diff @@ -0,0 +1,164 @@ +--- old.parserRealSource1.errors.txt ++++ new.parserRealSource1.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource1.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- export module CompilerDiagnostics { +- export var debug = false; +- export interface IDiagnosticWriter { +- Alert(output: string): void; +- } +- +- export var diagnosticWriter: IDiagnosticWriter = null; +- +- export var analysisPass: number = 0; +- +- export function Alert(output: string) { +- if (diagnosticWriter) { +- diagnosticWriter.Alert(output); +- } +- } +- +- export function debugPrint(s: string) { +- if (debug) { +- Alert(s); +- } +- } +- +- export function assert(condition: boolean, s: string) { +- if (debug) { +- if (!condition) { +- Alert(s); +- } +- } +- } +- +- } +- +- export interface ILogger { +- information(): boolean; +- debug(): boolean; +- warning(): boolean; +- error(): boolean; +- fatal(): boolean; +- log(s: string): void; +- } +- +- export class NullLogger implements ILogger { +- public information(): boolean { return false; } +- public debug(): boolean { return false; } +- public warning(): boolean { return false; } +- public error(): boolean { return false; } +- public fatal(): boolean { return false; } +- public log(s: string): void { +- } +- } +- +- export class LoggerAdapter implements ILogger { +- private _information: boolean; +- private _debug: boolean; +- private _warning: boolean; +- private _error: boolean; +- private _fatal: boolean; +- +- constructor (public logger: ILogger) { +- this._information = this.logger.information(); +- this._debug = this.logger.debug(); +- this._warning = this.logger.warning(); +- this._error = this.logger.error(); +- this._fatal = this.logger.fatal(); +- } +- +- +- public information(): boolean { return this._information; } +- public debug(): boolean { return this._debug; } +- public warning(): boolean { return this._warning; } +- public error(): boolean { return this._error; } +- public fatal(): boolean { return this._fatal; } +- public log(s: string): void { +- this.logger.log(s); +- } +- } +- +- export class BufferedLogger implements ILogger { +- public logContents = []; +- +- public information(): boolean { return false; } +- public debug(): boolean { return false; } +- public warning(): boolean { return false; } +- public error(): boolean { return false; } +- public fatal(): boolean { return false; } +- public log(s: string): void { +- this.logContents.push(s); +- } +- } +- +- export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { +- var start = +new Date(); +- var result = func(); +- var end = +new Date(); +- logger.log(funcDescription + " completed in " + (end - start) + " msec"); +- return result; +- } +- +- export function stringToLiteral(value: string, length: number): string { +- var result = ""; +- +- var addChar = (index: number) => { +- var ch = value.charCodeAt(index); +- switch (ch) { +- case 0x09: // tab +- result += "\\t"; +- break; +- case 0x0a: // line feed +- result += "\\n"; +- break; +- case 0x0b: // vertical tab +- result += "\\v"; +- break; +- case 0x0c: // form feed +- result += "\\f"; +- break; +- case 0x0d: // carriage return +- result += "\\r"; +- break; +- case 0x22: // double quote +- result += "\\\""; +- break; +- case 0x27: // single quote +- result += "\\\'"; +- break; +- case 0x5c: // Backslash +- result += "\\"; +- break; +- default: +- result += value.charAt(index); +- } +- } +- +- var tooLong = (value.length > length); +- if (tooLong) { +- var mid = length >> 1; +- for (var i = 0; i < mid; i++) addChar(i); +- result += "(...)"; +- for (var i = value.length - mid; i < value.length; i++) addChar(i); +- } +- else { +- length = value.length; +- for (var i = 0; i < length; i++) addChar(i); +- } +- return result; +- } +- } +- ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt index e0e0ea045a..d910c1c159 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt @@ -1,4 +1,3 @@ -parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -343,13 +342,11 @@ parserRealSource10.ts(356,53): error TS2304: Cannot find name 'NodeType'. parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. -==== parserRealSource10.ts (343 errors) ==== +==== parserRealSource10.ts (342 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export enum TokenID { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff new file mode 100644 index 0000000000..302ee058f5 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource10.errors.txt ++++ new.parserRealSource10.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. + parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. + parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. +@@= skipped -342, +341 lines =@@ + parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. + + +-==== parserRealSource10.ts (343 errors) ==== ++==== parserRealSource10.ts (342 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export enum TokenID { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt index 4584962cc2..301c863fe3 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt @@ -1,4 +1,3 @@ -parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -511,13 +510,11 @@ parserRealSource11.ts(2356,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== parserRealSource11.ts (511 errors) ==== +==== parserRealSource11.ts (510 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class ASTSpan { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff index 73ab595bfe..81f82295d6 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource11.errors.txt +++ new.parserRealSource11.errors.txt -@@= skipped -44, +44 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. + parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. + parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. +@@= skipped -44, +43 lines =@@ parserRealSource11.ts(219,33): error TS2304: Cannot find name 'NodeType'. parserRealSource11.ts(231,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(231,48): error TS2304: Cannot find name 'TokenID'. @@ -273,7 +278,22 @@ parserRealSource11.ts(2312,42): error TS2304: Cannot find name 'ControlFlowContext'. parserRealSource11.ts(2320,36): error TS2304: Cannot find name 'TypeFlow'. parserRealSource11.ts(2331,19): error TS2304: Cannot find name 'NodeType'. -@@= skipped -338, +338 lines =@@ +@@= skipped -9, +9 lines =@@ + parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. + + +-==== parserRealSource11.ts (511 errors) ==== ++==== parserRealSource11.ts (510 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export class ASTSpan { +@@= skipped -329, +327 lines =@@ emitter.recordSourceMappingStart(this); emitter.emitJavascriptList(this, null, TokenID.Semicolon, startLine, false, false); ~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt index 65f0af9317..469eb6ebc9 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt @@ -1,4 +1,3 @@ -parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. @@ -209,13 +208,11 @@ parserRealSource12.ts(523,88): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. -==== parserRealSource12.ts (209 errors) ==== +==== parserRealSource12.ts (208 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export interface IAstWalker { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff index 9d0f9c4570..5a68c67dd6 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource12.errors.txt +++ new.parserRealSource12.errors.txt -@@= skipped -154, +154 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. + parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. + parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. +@@= skipped -154, +153 lines =@@ parserRealSource12.ts(371,84): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(378,62): error TS2304: Cannot find name 'DoWhileStatement'. parserRealSource12.ts(378,88): error TS2304: Cannot find name 'AST'. @@ -36,7 +41,22 @@ parserRealSource12.ts(465,81): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(469,39): error TS2304: Cannot find name 'ASTList'. parserRealSource12.ts(473,42): error TS2304: Cannot find name 'ASTList'. -@@= skipped -741, +741 lines =@@ +@@= skipped -40, +40 lines =@@ + parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. + + +-==== parserRealSource12.ts (209 errors) ==== ++==== parserRealSource12.ts (208 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export interface IAstWalker { +@@= skipped -701, +699 lines =@@ export function walkBlockChildren(preAst: Block, parent: AST, walker: IAstWalker): void { ~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt index 45a111a3a4..edd2adfa16 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt @@ -1,4 +1,3 @@ -parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. @@ -116,13 +115,11 @@ parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? -==== parserRealSource13.ts (116 errors) ==== +==== parserRealSource13.ts (115 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { export interface AstWalkerDetailCallback { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff index d59cc36493..589c40b732 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource13.errors.txt +++ new.parserRealSource13.errors.txt -@@= skipped -81, +81 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. + parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. + parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. +@@= skipped -81, +80 lines =@@ parserRealSource13.ts(88,32): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(89,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(90,37): error TS2304: Cannot find name 'AST'. @@ -14,11 +19,23 @@ parserRealSource13.ts(128,33): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. -parserRealSource13.ts(135,36): error TS2304: Cannot find name 'NodeType'. +- +- +-==== parserRealSource13.ts (116 errors) ==== +parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? - - - ==== parserRealSource13.ts (116 errors) ==== -@@= skipped -264, +264 lines =@@ ++ ++ ++==== parserRealSource13.ts (115 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript.AstWalkerWithDetailCallback { + export interface AstWalkerDetailCallback { +@@= skipped -264, +262 lines =@@ !!! error TS2304: Cannot find name 'AST'. BlockCallback? (pre, block: Block): boolean; ~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt index 417b0c7c6b..cee28fce0c 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt @@ -1,4 +1,3 @@ -parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. @@ -160,13 +159,11 @@ parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no expor parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource14.ts (160 errors) ==== +==== parserRealSource14.ts (159 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export function lastOf(items: any[]): any { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff new file mode 100644 index 0000000000..112eb0b83a --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource14.errors.txt ++++ new.parserRealSource14.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. + parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. + parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. +@@= skipped -159, +158 lines =@@ + parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. + + +-==== parserRealSource14.ts (160 errors) ==== ++==== parserRealSource14.ts (159 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export function lastOf(items: any[]): any { \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt deleted file mode 100644 index fe21785dbd..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt +++ /dev/null @@ -1,277 +0,0 @@ -parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource2.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - - export function hasFlag(val: number, flag: number) { - return (val & flag) != 0; - } - - export enum ErrorRecoverySet { - None = 0, - Comma = 1, // Comma - SColon = 1 << 1, // SColon - Asg = 1 << 2, // Asg - BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv - // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, - // Pct, GT, LT, And, Xor, Or - RBrack = 1 << 4, // RBrack - RCurly = 1 << 5, // RCurly - RParen = 1 << 6, // RParen - Dot = 1 << 7, // Dot - Colon = 1 << 8, // Colon - PrimType = 1 << 9, // number, string, boolean - AddOp = 1 << 10, // Add, Sub - LCurly = 1 << 11, // LCurly - PreOp = 1 << 12, // Tilde, Bang, Inc, Dec - RegExp = 1 << 13, // RegExp - LParen = 1 << 14, // LParen - LBrack = 1 << 15, // LBrack - Scope = 1 << 16, // Scope - In = 1 << 17, // IN - SCase = 1 << 18, // CASE, DEFAULT - Else = 1 << 19, // ELSE - Catch = 1 << 20, // CATCH, FINALLY - Var = 1 << 21, // - Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH - While = 1 << 23, // WHILE - ID = 1 << 24, // ID - Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT - Literal = 1 << 26, // IntCon, FltCon, StrCon - RLit = 1 << 27, // THIS, TRUE, FALSE, NULL - Func = 1 << 28, // FUNCTION - EOF = 1 << 29, // EOF - - // REVIEW: Name this something clearer. - TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT - ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, - StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, - Postfix = Dot | LParen | LBrack, - } - - export enum AllowedElements { - None = 0, - ModuleDeclarations = 1 << 2, - ClassDeclarations = 1 << 3, - InterfaceDeclarations = 1 << 4, - AmbientDeclarations = 1 << 10, - Properties = 1 << 11, - - Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, - QuickParse = Global | Properties, - } - - export enum Modifiers { - None = 0, - Private = 1, - Public = 1 << 1, - Readonly = 1 << 2, - Ambient = 1 << 3, - Exported = 1 << 4, - Getter = 1 << 5, - Setter = 1 << 6, - Static = 1 << 7, - } - - export enum ASTFlags { - None = 0, - ExplicitSemicolon = 1, // statment terminated by an explicit semicolon - AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon - Writeable = 1 << 2, // node is lhs that can be modified - Error = 1 << 3, // node has an error - DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor - DotLHS = 1 << 5, // node is the lhs of a dot expr - IsStatement = 1 << 6, // node is a statement - StrictMode = 1 << 7, // node is in the strict mode environment - PossibleOptionalParameter = 1 << 8, - ClassBaseConstructorCall = 1 << 9, - OptionalName = 1 << 10, - // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. - // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. - // Once we have a better way to associate information with nodes, this flag should not be used. - SkipNextRParen = 1 << 11, - } - - export enum DeclFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - } - - export enum ModuleFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - IsEnum = 1 << 8, - ShouldEmitModuleDecl = 1 << 9, - IsWholeFile = 1 << 10, - IsDynamic = 1 << 11, - MustCaptureThis = 1 << 12, - } - - export enum SymbolFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - Property = 1 << 8, - Readonly = 1 << 9, - ModuleMember = 1 << 10, - InterfaceMember = 1 << 11, - ClassMember = 1 << 12, - BuiltIn = 1 << 13, - TypeSetDuringScopeAssignment = 1 << 14, - Constant = 1 << 15, - Optional = 1 << 16, - RecursivelyReferenced = 1 << 17, - Bound = 1 << 18, - CompilerGenerated = 1 << 19, - } - - export enum VarFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - AutoInit = 1 << 8, - Property = 1 << 9, - Readonly = 1 << 10, - Class = 1 << 11, - ClassProperty = 1 << 12, - ClassBodyProperty = 1 << 13, - ClassConstructorProperty = 1 << 14, - ClassSuperMustBeFirstCallInConstructor = 1 << 15, - Constant = 1 << 16, - MustCaptureThis = 1 << 17, - } - - export enum FncFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - Definition = 1 << 8, - Signature = 1 << 9, - Method = 1 << 10, - HasReturnExpression = 1 << 11, - CallMember = 1 << 12, - ConstructMember = 1 << 13, - HasSelfReference = 1 << 14, - IsFatArrowFunction = 1 << 15, - IndexerMember = 1 << 16, - IsFunctionExpression = 1 << 17, - ClassMethod = 1 << 18, - ClassPropertyMethodExported = 1 << 19, - } - - export enum SignatureFlags { - None = 0, - IsIndexer = 1, - IsStringIndexer = 1 << 1, - IsNumberIndexer = 1 << 2, - } - - export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; - export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; - export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; - export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; - export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { - return fncOrVarOrSymbolOrModuleFlags; - } - - export enum TypeFlags { - None = 0, - HasImplementation = 1, - HasSelfReference = 1 << 1, - MergeResult = 1 << 2, - IsEnum = 1 << 3, - BuildingName = 1 << 4, - HasBaseType = 1 << 5, - HasBaseTypeOfObject = 1 << 6, - IsClass = 1 << 7, - } - - export enum TypeRelationshipFlags { - SuccessfulComparison = 0, - SourceIsNullTargetIsVoidOrUndefined = 1, - RequiredPropertyIsMissing = 1 << 1, - IncompatibleSignatures = 1 << 2, - SourceSignatureHasTooManyParameters = 3, - IncompatibleReturnTypes = 1 << 4, - IncompatiblePropertyTypes = 1 << 5, - IncompatibleParameterTypes = 1 << 6, - } - - export enum CodeGenTarget { - ES3 = 0, - ES5 = 1, - } - - export enum ModuleGenTarget { - Synchronous = 0, - Asynchronous = 1, - Local = 1 << 1, - } - - // Compiler defaults to generating ES5-compliant code for - // - getters and setters - export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; - - export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; - - export var optimizeModuleCodeGen = true; - - export function flagsToString(e, flags: number): string { - var builder = ""; - for (var i = 1; i < (1 << 31) ; i = i << 1) { - if ((flags & i) != 0) { - for (var k in e) { - if (e[k] == i) { - if (builder.length > 0) { - builder += "|"; - } - builder += k; - break; - } - } - } - } - return builder; - } - - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff new file mode 100644 index 0000000000..1474c69126 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt.diff @@ -0,0 +1,281 @@ +--- old.parserRealSource2.errors.txt ++++ new.parserRealSource2.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource2.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- +- export function hasFlag(val: number, flag: number) { +- return (val & flag) != 0; +- } +- +- export enum ErrorRecoverySet { +- None = 0, +- Comma = 1, // Comma +- SColon = 1 << 1, // SColon +- Asg = 1 << 2, // Asg +- BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv +- // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, +- // Pct, GT, LT, And, Xor, Or +- RBrack = 1 << 4, // RBrack +- RCurly = 1 << 5, // RCurly +- RParen = 1 << 6, // RParen +- Dot = 1 << 7, // Dot +- Colon = 1 << 8, // Colon +- PrimType = 1 << 9, // number, string, boolean +- AddOp = 1 << 10, // Add, Sub +- LCurly = 1 << 11, // LCurly +- PreOp = 1 << 12, // Tilde, Bang, Inc, Dec +- RegExp = 1 << 13, // RegExp +- LParen = 1 << 14, // LParen +- LBrack = 1 << 15, // LBrack +- Scope = 1 << 16, // Scope +- In = 1 << 17, // IN +- SCase = 1 << 18, // CASE, DEFAULT +- Else = 1 << 19, // ELSE +- Catch = 1 << 20, // CATCH, FINALLY +- Var = 1 << 21, // +- Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH +- While = 1 << 23, // WHILE +- ID = 1 << 24, // ID +- Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT +- Literal = 1 << 26, // IntCon, FltCon, StrCon +- RLit = 1 << 27, // THIS, TRUE, FALSE, NULL +- Func = 1 << 28, // FUNCTION +- EOF = 1 << 29, // EOF +- +- // REVIEW: Name this something clearer. +- TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT +- ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, +- StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, +- Postfix = Dot | LParen | LBrack, +- } +- +- export enum AllowedElements { +- None = 0, +- ModuleDeclarations = 1 << 2, +- ClassDeclarations = 1 << 3, +- InterfaceDeclarations = 1 << 4, +- AmbientDeclarations = 1 << 10, +- Properties = 1 << 11, +- +- Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, +- QuickParse = Global | Properties, +- } +- +- export enum Modifiers { +- None = 0, +- Private = 1, +- Public = 1 << 1, +- Readonly = 1 << 2, +- Ambient = 1 << 3, +- Exported = 1 << 4, +- Getter = 1 << 5, +- Setter = 1 << 6, +- Static = 1 << 7, +- } +- +- export enum ASTFlags { +- None = 0, +- ExplicitSemicolon = 1, // statment terminated by an explicit semicolon +- AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon +- Writeable = 1 << 2, // node is lhs that can be modified +- Error = 1 << 3, // node has an error +- DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor +- DotLHS = 1 << 5, // node is the lhs of a dot expr +- IsStatement = 1 << 6, // node is a statement +- StrictMode = 1 << 7, // node is in the strict mode environment +- PossibleOptionalParameter = 1 << 8, +- ClassBaseConstructorCall = 1 << 9, +- OptionalName = 1 << 10, +- // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. +- // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. +- // Once we have a better way to associate information with nodes, this flag should not be used. +- SkipNextRParen = 1 << 11, +- } +- +- export enum DeclFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- } +- +- export enum ModuleFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- IsEnum = 1 << 8, +- ShouldEmitModuleDecl = 1 << 9, +- IsWholeFile = 1 << 10, +- IsDynamic = 1 << 11, +- MustCaptureThis = 1 << 12, +- } +- +- export enum SymbolFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- Property = 1 << 8, +- Readonly = 1 << 9, +- ModuleMember = 1 << 10, +- InterfaceMember = 1 << 11, +- ClassMember = 1 << 12, +- BuiltIn = 1 << 13, +- TypeSetDuringScopeAssignment = 1 << 14, +- Constant = 1 << 15, +- Optional = 1 << 16, +- RecursivelyReferenced = 1 << 17, +- Bound = 1 << 18, +- CompilerGenerated = 1 << 19, +- } +- +- export enum VarFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- AutoInit = 1 << 8, +- Property = 1 << 9, +- Readonly = 1 << 10, +- Class = 1 << 11, +- ClassProperty = 1 << 12, +- ClassBodyProperty = 1 << 13, +- ClassConstructorProperty = 1 << 14, +- ClassSuperMustBeFirstCallInConstructor = 1 << 15, +- Constant = 1 << 16, +- MustCaptureThis = 1 << 17, +- } +- +- export enum FncFlags { +- None = 0, +- Exported = 1, +- Private = 1 << 1, +- Public = 1 << 2, +- Ambient = 1 << 3, +- Static = 1 << 4, +- LocalStatic = 1 << 5, +- GetAccessor = 1 << 6, +- SetAccessor = 1 << 7, +- Definition = 1 << 8, +- Signature = 1 << 9, +- Method = 1 << 10, +- HasReturnExpression = 1 << 11, +- CallMember = 1 << 12, +- ConstructMember = 1 << 13, +- HasSelfReference = 1 << 14, +- IsFatArrowFunction = 1 << 15, +- IndexerMember = 1 << 16, +- IsFunctionExpression = 1 << 17, +- ClassMethod = 1 << 18, +- ClassPropertyMethodExported = 1 << 19, +- } +- +- export enum SignatureFlags { +- None = 0, +- IsIndexer = 1, +- IsStringIndexer = 1 << 1, +- IsNumberIndexer = 1 << 2, +- } +- +- export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; +- export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; +- export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; +- export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; +- export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { +- return fncOrVarOrSymbolOrModuleFlags; +- } +- +- export enum TypeFlags { +- None = 0, +- HasImplementation = 1, +- HasSelfReference = 1 << 1, +- MergeResult = 1 << 2, +- IsEnum = 1 << 3, +- BuildingName = 1 << 4, +- HasBaseType = 1 << 5, +- HasBaseTypeOfObject = 1 << 6, +- IsClass = 1 << 7, +- } +- +- export enum TypeRelationshipFlags { +- SuccessfulComparison = 0, +- SourceIsNullTargetIsVoidOrUndefined = 1, +- RequiredPropertyIsMissing = 1 << 1, +- IncompatibleSignatures = 1 << 2, +- SourceSignatureHasTooManyParameters = 3, +- IncompatibleReturnTypes = 1 << 4, +- IncompatiblePropertyTypes = 1 << 5, +- IncompatibleParameterTypes = 1 << 6, +- } +- +- export enum CodeGenTarget { +- ES3 = 0, +- ES5 = 1, +- } +- +- export enum ModuleGenTarget { +- Synchronous = 0, +- Asynchronous = 1, +- Local = 1 << 1, +- } +- +- // Compiler defaults to generating ES5-compliant code for +- // - getters and setters +- export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; +- +- export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; +- +- export var optimizeModuleCodeGen = true; +- +- export function flagsToString(e, flags: number): string { +- var builder = ""; +- for (var i = 1; i < (1 << 31) ; i = i << 1) { +- if ((flags & i) != 0) { +- for (var k in e) { +- if (e[k] == i) { +- if (builder.length > 0) { +- builder += "|"; +- } +- builder += k; +- break; +- } +- } +- } +- } +- return builder; +- } +- +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt deleted file mode 100644 index ad9c1f9ac6..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt +++ /dev/null @@ -1,125 +0,0 @@ -parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource3.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback - export enum NodeType { - None, - Empty, - EmptyExpr, - True, - False, - This, - Super, - QString, - Regex, - Null, - ArrayLit, - ObjectLit, - Void, - Comma, - Pos, - Neg, - Delete, - Await, - In, - Dot, - From, - Is, - InstOf, - Typeof, - NumberLit, - Name, - TypeRef, - Index, - Call, - New, - Asg, - AsgAdd, - AsgSub, - AsgDiv, - AsgMul, - AsgMod, - AsgAnd, - AsgXor, - AsgOr, - AsgLsh, - AsgRsh, - AsgRs2, - ConditionalExpression, - LogOr, - LogAnd, - Or, - Xor, - And, - Eq, - Ne, - Eqv, - NEqv, - Lt, - Le, - Gt, - Ge, - Add, - Sub, - Mul, - Div, - Mod, - Lsh, - Rsh, - Rs2, - Not, - LogNot, - IncPre, - DecPre, - IncPost, - DecPost, - TypeAssertion, - FuncDecl, - Member, - VarDecl, - ArgDecl, - Return, - Break, - Continue, - Throw, - For, - ForIn, - If, - While, - DoWhile, - Block, - Case, - Switch, - Try, - TryCatch, - TryFinally, - Finally, - Catch, - List, - Script, - ClassDeclaration, - InterfaceDeclaration, - ModuleDeclaration, - ImportDeclaration, - With, - Label, - LabeledStatement, - EBStart, - GotoEB, - EndCode, - Error, - Comment, - Debugger, - GeneralNode = FuncDecl, - LastAsg = AsgRs2, - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff new file mode 100644 index 0000000000..abd13c93f3 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt.diff @@ -0,0 +1,129 @@ +--- old.parserRealSource3.errors.txt ++++ new.parserRealSource3.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. +- +- +-==== parserRealSource3.ts (1 errors) ==== +- // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. +- // See LICENSE.txt in the project root for complete license information. +- +- /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. +- +- module TypeScript { +- // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback +- export enum NodeType { +- None, +- Empty, +- EmptyExpr, +- True, +- False, +- This, +- Super, +- QString, +- Regex, +- Null, +- ArrayLit, +- ObjectLit, +- Void, +- Comma, +- Pos, +- Neg, +- Delete, +- Await, +- In, +- Dot, +- From, +- Is, +- InstOf, +- Typeof, +- NumberLit, +- Name, +- TypeRef, +- Index, +- Call, +- New, +- Asg, +- AsgAdd, +- AsgSub, +- AsgDiv, +- AsgMul, +- AsgMod, +- AsgAnd, +- AsgXor, +- AsgOr, +- AsgLsh, +- AsgRsh, +- AsgRs2, +- ConditionalExpression, +- LogOr, +- LogAnd, +- Or, +- Xor, +- And, +- Eq, +- Ne, +- Eqv, +- NEqv, +- Lt, +- Le, +- Gt, +- Ge, +- Add, +- Sub, +- Mul, +- Div, +- Mod, +- Lsh, +- Rsh, +- Rs2, +- Not, +- LogNot, +- IncPre, +- DecPre, +- IncPost, +- DecPost, +- TypeAssertion, +- FuncDecl, +- Member, +- VarDecl, +- ArgDecl, +- Return, +- Break, +- Continue, +- Throw, +- For, +- ForIn, +- If, +- While, +- DoWhile, +- Block, +- Case, +- Switch, +- Try, +- TryCatch, +- TryFinally, +- Finally, +- Catch, +- List, +- Script, +- ClassDeclaration, +- InterfaceDeclaration, +- ModuleDeclaration, +- ImportDeclaration, +- With, +- Label, +- LabeledStatement, +- EBStart, +- GotoEB, +- EndCode, +- Error, +- Comment, +- Debugger, +- GeneralNode = FuncDecl, +- LastAsg = AsgRs2, +- } +- } ++ \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt index d20b223402..f3bf960e1d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt @@ -1,14 +1,11 @@ -parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. -==== parserRealSource4.ts (2 errors) ==== +==== parserRealSource4.ts (1 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff new file mode 100644 index 0000000000..a20c55edde --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt.diff @@ -0,0 +1,18 @@ +--- old.parserRealSource4.errors.txt ++++ new.parserRealSource4.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. + + +-==== parserRealSource4.ts (2 errors) ==== ++==== parserRealSource4.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt index 9166edb4e6..8e13f7af9d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt @@ -1,4 +1,3 @@ -parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. @@ -9,13 +8,11 @@ parserRealSource5.ts(61,52): error TS2304: Cannot find name 'AST'. parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. -==== parserRealSource5.ts (9 errors) ==== +==== parserRealSource5.ts (8 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { // TODO: refactor indent logic for use in emit diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff new file mode 100644 index 0000000000..5c7ec99caf --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt.diff @@ -0,0 +1,22 @@ +--- old.parserRealSource5.errors.txt ++++ new.parserRealSource5.errors.txt +@@= skipped -0, +0 lines =@@ +-parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. + parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. + parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. +@@= skipped -8, +7 lines =@@ + parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. + + +-==== parserRealSource5.ts (9 errors) ==== ++==== parserRealSource5.ts (8 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + // TODO: refactor indent logic for use in emit \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt index 0c55b63b07..6d21559554 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt @@ -1,4 +1,3 @@ -parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. @@ -60,13 +59,11 @@ parserRealSource6.ts(212,81): error TS2304: Cannot find name 'ISourceText'. parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource6.ts (60 errors) ==== +==== parserRealSource6.ts (59 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class TypeCollectionContext { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff index f7b30ecddc..56c1619149 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource6.errors.txt +++ new.parserRealSource6.errors.txt -@@= skipped -11, +11 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. + parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. + parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. +@@= skipped -11, +10 lines =@@ parserRealSource6.ts(27,48): error TS2304: Cannot find name 'SymbolScope'. parserRealSource6.ts(28,31): error TS2304: Cannot find name 'AST'. parserRealSource6.ts(30,35): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -18,7 +23,22 @@ parserRealSource6.ts(142,22): error TS2304: Cannot find name 'NodeType'. parserRealSource6.ts(143,38): error TS2304: Cannot find name 'UnaryExpression'. parserRealSource6.ts(156,22): error TS2304: Cannot find name 'NodeType'. -@@= skipped -77, +77 lines =@@ +@@= skipped -16, +16 lines =@@ + parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. + + +-==== parserRealSource6.ts (60 errors) ==== ++==== parserRealSource6.ts (59 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export class TypeCollectionContext { +@@= skipped -61, +59 lines =@@ !!! error TS2304: Cannot find name 'ModuleDeclaration'. public enclosingClassDecl: TypeDeclaration = null; ~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt index e91833fac9..9103a77c23 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt @@ -1,4 +1,3 @@ -parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? @@ -304,13 +303,11 @@ parserRealSource7.ts(827,34): error TS2304: Cannot find name 'NodeType'. parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. -==== parserRealSource7.ts (304 errors) ==== +==== parserRealSource7.ts (303 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Continuation { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff index 0b6378c5c9..beb218b82b 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource7.errors.txt +++ new.parserRealSource7.errors.txt -@@= skipped -10, +10 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. + parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. + parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? +@@= skipped -10, +9 lines =@@ parserRealSource7.ts(34,68): error TS2304: Cannot find name 'TypeCollectionContext'. parserRealSource7.ts(35,25): error TS2304: Cannot find name 'ValueLocation'. parserRealSource7.ts(36,30): error TS2304: Cannot find name 'TypeLink'. @@ -88,7 +93,22 @@ parserRealSource7.ts(535,53): error TS2304: Cannot find name 'VarFlags'. parserRealSource7.ts(535,75): error TS2304: Cannot find name 'VarFlags'. parserRealSource7.ts(539,38): error TS2304: Cannot find name 'SymbolFlags'. -@@= skipped -158, +158 lines =@@ +@@= skipped -86, +86 lines =@@ + parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. + + +-==== parserRealSource7.ts (304 errors) ==== ++==== parserRealSource7.ts (303 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export class Continuation { +@@= skipped -72, +70 lines =@@ var fieldSymbol = new FieldSymbol("prototype", ast.minChar, ~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt index 56c4a714dc..359492c310 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt @@ -1,4 +1,3 @@ -parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -130,13 +129,11 @@ parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? -==== parserRealSource8.ts (130 errors) ==== +==== parserRealSource8.ts (129 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff index b10455680c..c6ad58808b 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource8.errors.txt +++ new.parserRealSource8.errors.txt -@@= skipped -39, +39 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. + parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. + parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. +@@= skipped -39, +38 lines =@@ parserRealSource8.ts(160,76): error TS2304: Cannot find name 'StringHashTable'. parserRealSource8.ts(160,99): error TS2304: Cannot find name 'StringHashTable'. parserRealSource8.ts(162,28): error TS2304: Cannot find name 'Type'. @@ -30,11 +35,23 @@ parserRealSource8.ts(449,76): error TS2304: Cannot find name 'FncFlags'. parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. -parserRealSource8.ts(454,35): error TS2304: Cannot find name 'Catch'. +- +- +-==== parserRealSource8.ts (130 errors) ==== +parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? - - - ==== parserRealSource8.ts (130 errors) ==== -@@= skipped -252, +252 lines =@@ ++ ++ ++==== parserRealSource8.ts (129 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + +@@= skipped -252, +250 lines =@@ !!! error TS2304: Cannot find name 'Type'. var withSymbol = new WithSymbol(withStmt.minChar, context.typeFlow.checker.locationInfo.unitIndex, withType); ~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt index 9fd2058cb8..dffb11e04a 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt @@ -1,4 +1,3 @@ -parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -39,13 +38,11 @@ parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -==== parserRealSource9.ts (39 errors) ==== +==== parserRealSource9.ts (38 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Binder { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff index 7126ae5383..ec66794d0e 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserRealSource9.errors.txt +++ new.parserRealSource9.errors.txt -@@= skipped -9, +9 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. + parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. + parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. + parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. +@@= skipped -9, +8 lines =@@ parserRealSource9.ts(67,54): error TS2304: Cannot find name 'SignatureGroup'. parserRealSource9.ts(67,77): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(67,104): error TS2304: Cannot find name 'Type'. @@ -18,7 +23,20 @@ parserRealSource9.ts(197,20): error TS2339: Property 'bound' does not exist on type 'Symbol'. parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -@@= skipped -115, +115 lines =@@ + + +-==== parserRealSource9.ts (39 errors) ==== ++==== parserRealSource9.ts (38 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export class Binder { +@@= skipped -115, +113 lines =@@ // check that last parameter has an array type var lastParam = signature.parameters[paramLen - 1]; ~~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt index a476f8e9cd..31a75354a8 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt @@ -1,7 +1,3 @@ -parserharness.ts(16,21): error TS6053: File '/compiler/io.ts' not found. -parserharness.ts(17,21): error TS6053: File '/compiler/typescript.ts' not found. -parserharness.ts(18,21): error TS6053: File '/services/typescriptServices.ts' not found. -parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. @@ -110,7 +106,7 @@ parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? -==== parserharness.ts (110 errors) ==== +==== parserharness.ts (106 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -127,17 +123,9 @@ parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean ' // /// - ~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '/compiler/io.ts' not found. /// - ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '/compiler/typescript.ts' not found. /// - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '/services/typescriptServices.ts' not found. /// - ~~~~~~~ -!!! error TS6053: File 'diff.ts' not found. declare var assert: Harness.Assert; ~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff index 989c52bd3a..e36a9f9461 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt.diff @@ -4,13 +4,11 @@ -parserharness.ts(16,21): error TS6053: File '../compiler/io.ts' not found. -parserharness.ts(17,21): error TS6053: File '../compiler/typescript.ts' not found. -parserharness.ts(18,21): error TS6053: File '../services/typescriptServices.ts' not found. -+parserharness.ts(16,21): error TS6053: File '/compiler/io.ts' not found. -+parserharness.ts(17,21): error TS6053: File '/compiler/typescript.ts' not found. -+parserharness.ts(18,21): error TS6053: File '/services/typescriptServices.ts' not found. - parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. +-parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. -@@= skipped -17, +17 lines =@@ + parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. +@@= skipped -17, +13 lines =@@ parserharness.ts(724,29): error TS2304: Cannot find name 'ITextWriter'. parserharness.ts(754,53): error TS2552: Cannot find name 'TypeScript'. Did you mean 'TypeScriptLS'? parserharness.ts(764,56): error TS2503: Cannot find namespace 'TypeScript'. @@ -143,28 +141,35 @@ parserharness.ts(1787,38): error TS2503: Cannot find namespace 'Services'. parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. -parserharness.ts(2030,32): error TS2304: Cannot find name 'Diff'. +- +- +-==== parserharness.ts (110 errors) ==== +parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? - - - ==== parserharness.ts (110 errors) ==== -@@= skipped -21, +21 lines =@@ ++ ++ ++==== parserharness.ts (106 errors) ==== + // + // Copyright (c) Microsoft Corporation. All rights reserved. + // +@@= skipped -20, +20 lines =@@ + // /// - ~~~~~~~~~~~~~~~~~ +- ~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../compiler/io.ts' not found. -+!!! error TS6053: File '/compiler/io.ts' not found. /// - ~~~~~~~~~~~~~~~~~~~~~~~~~ +- ~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../compiler/typescript.ts' not found. -+!!! error TS6053: File '/compiler/typescript.ts' not found. /// - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File '../services/typescriptServices.ts' not found. -+!!! error TS6053: File '/services/typescriptServices.ts' not found. /// - ~~~~~~~ - !!! error TS6053: File 'diff.ts' not found. -@@= skipped -789, +789 lines =@@ +- ~~~~~~~ +-!!! error TS6053: File 'diff.ts' not found. + + declare var assert: Harness.Assert; + ~~~~~~~~~~~~~~ +@@= skipped -790, +782 lines =@@ !!! error TS2503: Cannot find namespace 'TypeScript'. var compiler = c || new TypeScript.TypeScriptCompiler(stderr); ~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt index ecef6e2a1d..c3eb8c504f 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt @@ -1,4 +1,3 @@ -parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -128,7 +127,7 @@ parserindenter.ts(735,42): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. -==== parserindenter.ts (128 errors) ==== +==== parserindenter.ts (127 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -145,8 +144,6 @@ parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. // /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'formatting.ts' not found. module Formatting { diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff index 01e624fb02..1497927902 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt.diff @@ -1,6 +1,11 @@ --- old.parserindenter.errors.txt +++ new.parserindenter.errors.txt -@@= skipped -10, +10 lines =@@ +@@= skipped -0, +0 lines =@@ +-parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. + parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. + parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. + parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. +@@= skipped -10, +9 lines =@@ parserindenter.ts(37,48): error TS2304: Cannot find name 'Dictionary_int_int'. parserindenter.ts(47,43): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(47,65): error TS2304: Cannot find name 'TokenSpan'. @@ -89,7 +94,25 @@ parserindenter.ts(717,22): error TS2304: Cannot find name 'AuthorTokenKind'. parserindenter.ts(718,73): error TS2304: Cannot find name 'AuthorParseNodeKind'. parserindenter.ts(721,22): error TS2304: Cannot find name 'AuthorTokenKind'. -@@= skipped -98, +98 lines =@@ +@@= skipped -23, +23 lines =@@ + parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. + + +-==== parserindenter.ts (128 errors) ==== ++==== parserindenter.ts (127 errors) ==== + // + // Copyright (c) Microsoft Corporation. All rights reserved. + // +@@= skipped -17, +17 lines =@@ + // + + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'formatting.ts' not found. + + + module Formatting { +@@= skipped -58, +56 lines =@@ ~~~~~~~~~ !!! error TS2304: Cannot find name 'TokenSpan'. ~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt index 833098432b..ca1c2ae9a6 100644 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt @@ -1,4 +1,3 @@ -scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? @@ -16,10 +15,8 @@ scannertest1.ts(19,23): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. -==== scannertest1.ts (16 errors) ==== +==== scannertest1.ts (15 errors) ==== /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'References.ts' not found. class CharacterInfo { public static isDecimalDigit(c: number): boolean { diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff new file mode 100644 index 0000000000..2d8965d4df --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt.diff @@ -0,0 +1,19 @@ +--- old.scannertest1.errors.txt ++++ new.scannertest1.errors.txt +@@= skipped -0, +0 lines =@@ +-scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. + scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. + scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. + scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? +@@= skipped -15, +14 lines =@@ + scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. + + +-==== scannertest1.ts (16 errors) ==== ++==== scannertest1.ts (15 errors) ==== + /// +- ~~~~~~~~~~~~~ +-!!! error TS6053: File 'References.ts' not found. + + class CharacterInfo { + public static isDecimalDigit(c: number): boolean { \ No newline at end of file diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js index 39e35c60f4..69a3eed6d1 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing-with-force.js @@ -66,7 +66,6 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... -error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. [HH:MM:SS AM] Project 'logic/tsconfig.json' is being forcibly rebuilt [HH:MM:SS AM] Building project 'logic/tsconfig.json'... @@ -86,7 +85,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~ -Found 3 errors in 2 files. +Found 2 errors in 2 files. Errors Files 1 logic/index.ts:5 @@ -131,11 +130,10 @@ function leftPad(s, n) { return s + n; } function multiply(a, b) { return a * b; } //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -193,13 +191,8 @@ function multiply(a, b) { return a * b; } "options": { "composite": true }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./index.ts", - "./some_decl.d.ts" - ], "latestChangedDtsFile": "./index.d.ts", - "size": 1590 + "size": 1539 } //// [/user/username/projects/sample1/logic/index.d.ts] *new* export declare function getSecondsInDay(): number; @@ -474,9 +467,9 @@ exports.m = mod; core/tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /user/username/projects/sample1/core/index.ts -*not cached* /user/username/projects/sample1/core/some_decl.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts Signatures:: (stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js index 91f397d078..d546837a27 100644 --- a/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js +++ b/testdata/baselines/reference/tsbuild/sample/reports-error-if-input-file-is-missing.js @@ -66,7 +66,6 @@ Output:: [HH:MM:SS AM] Building project 'core/tsconfig.json'... -error TS6053: File '/user/username/projects/sample1/core/anotherModule.ts' not found. [HH:MM:SS AM] Project 'logic/tsconfig.json' is out of date because output file 'logic/tsconfig.tsbuildinfo' does not exist [HH:MM:SS AM] Building project 'logic/tsconfig.json'... @@ -86,7 +85,7 @@ Output::    ~~~~~~~~~~~~~~~~~~~~~~~ -Found 3 errors in 2 files. +Found 2 errors in 2 files. Errors Files 1 logic/index.ts:5 @@ -131,11 +130,10 @@ function leftPad(s, n) { return s + n; } function multiply(a, b) { return a * b; } //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"semanticDiagnosticsPerFile":[1,2,3],"latestChangedDtsFile":"./index.d.ts"} +{"version":"FakeTSVersion","root":[[2,3]],"fileNames":["lib.d.ts","./index.ts","./some_decl.d.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"2753a1085d587a7d57069e1105af24ec-export const someString: string = \"HELLO WORLD\";\nexport function leftPad(s: string, n: number) { return s + n; }\nexport function multiply(a: number, b: number) { return a * b; }","signature":"da642d80443e7ccd327091080a82a43c-export declare const someString: string;\nexport declare function leftPad(s: string, n: number): string;\nexport declare function multiply(a: number, b: number): number;\n","impliedNodeFormat":1},{"version":"6ceab83400a6167be2fb5feab881ded0-declare const dts: any;","affectsGlobalScope":true,"impliedNodeFormat":1}],"options":{"composite":true},"latestChangedDtsFile":"./index.d.ts"} //// [/user/username/projects/sample1/core/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -193,13 +191,8 @@ function multiply(a, b) { return a * b; } "options": { "composite": true }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./index.ts", - "./some_decl.d.ts" - ], "latestChangedDtsFile": "./index.d.ts", - "size": 1590 + "size": 1539 } //// [/user/username/projects/sample1/logic/index.d.ts] *new* export declare function getSecondsInDay(): number; @@ -474,9 +467,9 @@ exports.m = mod; core/tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /user/username/projects/sample1/core/index.ts -*not cached* /user/username/projects/sample1/core/some_decl.d.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /user/username/projects/sample1/core/index.ts +*refresh* /user/username/projects/sample1/core/some_decl.d.ts Signatures:: (stored at emit) /user/username/projects/sample1/core/index.ts diff --git a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js index b3c39771d5..b7c372258f 100644 --- a/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js +++ b/testdata/baselines/reference/tsc/commandLine/Parse-enum-type-options.js @@ -3,12 +3,8 @@ useCaseSensitiveFileNames::true Input:: tsgo --moduleResolution nodenext first.ts --module nodenext --target esnext --moduleDetection auto --jsx react --newLine crlf -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -error TS6053: File '/home/src/workspaces/project/first.ts' not found. - -Found 1 error. - //// [/home/src/tslibs/TS/Lib/lib.esnext.full.d.ts] *Lib* /// interface Boolean {} diff --git a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js index dc0b3c7da7..ffe2a4f5a4 100644 --- a/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js +++ b/testdata/baselines/reference/tsc/incremental/when-global-file-is-added,-the-signatures-are-updated.js @@ -18,16 +18,8 @@ function main() { } } tsgo -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. - -2 /// -   ~~~~~~~~~~~~~~~~~ - - -Found 1 error in src/anotherFileWithSameReferenes.ts:2 - //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// interface Boolean {} @@ -74,11 +66,10 @@ declare function main(): void; function main() { } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"4e3124823e3ef0a7f1ce70b317b1e4c8-/// \n/// \nfunction main() { }","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -171,22 +162,16 @@ function main() { } "./src/fileNotFound.ts" ] }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./src/filePresent.ts", - "./src/anotherFileWithSameReferenes.ts", - "./src/main.ts" - ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1963 + "size": 1910 } tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/src/filePresent.ts -*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*not cached* /home/src/workspaces/project/src/main.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/filePresent.ts +*refresh* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts +*refresh* /home/src/workspaces/project/src/main.ts Signatures:: (stored at emit) /home/src/workspaces/project/src/filePresent.ts (stored at emit) /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts @@ -196,23 +181,11 @@ Signatures:: Edit [0]:: no change tsgo -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. - -2 /// -   ~~~~~~~~~~~~~~~~~ - - -Found 1 error in src/anotherFileWithSameReferenes.ts:2 - tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/src/filePresent.ts -*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*not cached* /home/src/workspaces/project/src/main.ts Signatures:: @@ -223,16 +196,8 @@ Edit [1]:: Modify main file function main() { }something(); tsgo -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. - -2 /// -   ~~~~~~~~~~~~~~~~~ - - -Found 1 error in src/anotherFileWithSameReferenes.ts:2 - //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -240,11 +205,10 @@ function main() { } something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"9ece2abeadfdd790ae17f754892e8402-/// \n/// \nfunction main() { }something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -337,22 +301,13 @@ something(); "./src/fileNotFound.ts" ] }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./src/filePresent.ts", - "./src/anotherFileWithSameReferenes.ts", - "./src/main.ts" - ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1975 + "size": 1922 } tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/src/filePresent.ts -*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*not cached* /home/src/workspaces/project/src/main.ts +*refresh* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -364,16 +319,8 @@ Edit [2]:: Modify main file again function main() { }something();something(); tsgo -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. - -2 /// -   ~~~~~~~~~~~~~~~~~ - - -Found 1 error in src/anotherFileWithSameReferenes.ts:2 - //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -382,11 +329,10 @@ something(); something(); //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"semanticDiagnosticsPerFile":[1,2,3,4],"latestChangedDtsFile":"./src/main.d.ts"} +{"version":"FakeTSVersion","root":[[2,4]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"1077a6c3f5daec777c602b0aac3793b9-/// \n/// \nfunction main() { }something();something();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,5]],"options":{"composite":true},"referencedMap":[[3,1],[4,1]],"latestChangedDtsFile":"./src/main.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -479,22 +425,13 @@ something(); "./src/fileNotFound.ts" ] }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./src/filePresent.ts", - "./src/anotherFileWithSameReferenes.ts", - "./src/main.ts" - ], "latestChangedDtsFile": "./src/main.d.ts", - "size": 1987 + "size": 1934 } tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/src/filePresent.ts -*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*not cached* /home/src/workspaces/project/src/main.ts +*refresh* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -509,16 +446,8 @@ function main() { }something();something();foo(); function foo() { return 20; } tsgo -ExitStatus:: DiagnosticsPresent_OutputsGenerated +ExitStatus:: Success Output:: -src/anotherFileWithSameReferenes.ts:2:22 - error TS6053: File '/home/src/workspaces/project/src/fileNotFound.ts' not found. - -2 /// -   ~~~~~~~~~~~~~~~~~ - - -Found 1 error in src/anotherFileWithSameReferenes.ts:2 - //// [/home/src/workspaces/project/src/main.js] *modified* /// /// @@ -535,11 +464,10 @@ declare function foo(): number; function foo() { return 20; } //// [/home/src/workspaces/project/tsconfig.tsbuildinfo] *modified* -{"version":"FakeTSVersion","errors":true,"root":[[2,5]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"semanticDiagnosticsPerFile":[1,2,3,4,5],"latestChangedDtsFile":"./src/newFile.d.ts"} +{"version":"FakeTSVersion","root":[[2,5]],"fileNames":["lib.d.ts","./src/filePresent.ts","./src/anotherFileWithSameReferenes.ts","./src/newFile.ts","./src/main.ts","./src/fileNotFound.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"90fb0189e81698eb72c5c92453cf2ab4-function something() { return 10; }","signature":"427bfa05de25170a9630b13346cde60c-declare function something(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"e70a47c0753d68cebbf1d60d9abf7212-/// \n/// \nfunction anotherFileWithSameReferenes() { }","signature":"d30ad74c2e698ad06cc29f2ea6d12014-declare function anotherFileWithSameReferenes(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"cf329dc888a898a1403ba3e35c2ec68e-function foo() { return 20; }","signature":"67af86f8c5b618332b620488f3be2c41-declare function foo(): number;\n","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"bc6af6fddab57e87e44b7bf54d933e49-/// \n/// \n/// \nfunction main() { }something();something();foo();","signature":"50f7afe296d55bfece856bfb6f7ad6c9-declare function main(): void;\n","affectsGlobalScope":true,"impliedNodeFormat":1}],"fileIdsList":[[2,6],[2,4,6]],"options":{"composite":true},"referencedMap":[[3,1],[5,2]],"latestChangedDtsFile":"./src/newFile.d.ts"} //// [/home/src/workspaces/project/tsconfig.tsbuildinfo.readable.baseline.txt] *modified* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -653,24 +581,15 @@ function foo() { return 20; } "./src/fileNotFound.ts" ] }, - "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "./src/filePresent.ts", - "./src/anotherFileWithSameReferenes.ts", - "./src/newFile.ts", - "./src/main.ts" - ], "latestChangedDtsFile": "./src/newFile.d.ts", - "size": 2271 + "size": 2216 } tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/src/filePresent.ts -*not cached* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*not cached* /home/src/workspaces/project/src/newFile.ts -*not cached* /home/src/workspaces/project/src/main.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/src/newFile.ts +*refresh* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/newFile.ts (computed .d.ts) /home/src/workspaces/project/src/main.ts @@ -830,10 +749,8 @@ function something2() { return 20; } tsconfig.json:: SemanticDiagnostics:: *refresh* /home/src/tslibs/TS/Lib/lib.d.ts -*refresh* /home/src/workspaces/project/src/filePresent.ts *refresh* /home/src/workspaces/project/src/fileNotFound.ts *refresh* /home/src/workspaces/project/src/anotherFileWithSameReferenes.ts -*refresh* /home/src/workspaces/project/src/newFile.ts *refresh* /home/src/workspaces/project/src/main.ts Signatures:: (computed .d.ts) /home/src/workspaces/project/src/fileNotFound.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js index abba0b4763..afa623062e 100644 --- a/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js +++ b/testdata/baselines/reference/tsc/projectReferences/errors-when-the-referenced-project-doesnt-have-composite.js @@ -25,22 +25,13 @@ import * as mod_1 from "../primary/a"; tsgo --p reference/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -reference/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/primary/bin/a.d.ts' not found. - -1 import * as mod_1 from "../primary/a"; -  ~ - reference/tsconfig.json:7:21 - error TS6306: Referenced project '/home/src/workspaces/project/primary' must have setting "composite": true. 7 "references": [ { "path": "../primary" } ]    ~~~~~~~~~~~~~~~~~~~~~~~~ -Found 2 errors in 2 files. - -Errors Files - 1 reference/b.ts:1 - 1 reference/tsconfig.json:7 +Found 1 error in reference/tsconfig.json:7 //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js index b41868e760..8175413de0 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing-when-module-reference-is-not-relative.js @@ -27,10 +27,10 @@ import { m } from '@alpha/a' tsgo --p beta/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -beta/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/alpha/bin/a.d.ts' not found. +beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. 1 import { m } from '@alpha/a' -  ~ +   ~~~~~~~~~~ Found 1 error in beta/b.ts:1 @@ -66,11 +66,10 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"311c3bac923f08ac35ab2246c3464fb7-import { m } from '@alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":28,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -113,16 +112,26 @@ Object.defineProperty(exports, "__esModule", { value: true }); "outDir": "./" }, "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "../b.ts" + [ + "../b.ts", + [ + { + "pos": 18, + "end": 28, + "code": 6305, + "category": 1, + "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + } + ] + ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1141 + "size": 1325 } beta/tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/beta/b.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/beta/b.ts Signatures:: (stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js index 188a1ef1c0..be88f86fa1 100644 --- a/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js +++ b/testdata/baselines/reference/tsc/projectReferences/issues-a-nice-error-when-the-input-file-is-missing.js @@ -25,10 +25,10 @@ import { m } from '../alpha/a' tsgo --p beta/tsconfig.json ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -beta/b.ts:1:1 - error TS6053: File '/home/src/workspaces/project/alpha/bin/a.d.ts' not found. +beta/b.ts:1:19 - error TS6305: Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'. 1 import { m } from '../alpha/a' -  ~ +   ~~~~~~~~~~~~ Found 1 error in beta/b.ts:1 @@ -64,11 +64,10 @@ export {}; Object.defineProperty(exports, "__esModule", { value: true }); //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo] *new* -{"version":"FakeTSVersion","errors":true,"root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[1,2],"latestChangedDtsFile":"./b.d.ts"} +{"version":"FakeTSVersion","root":[2],"fileNames":["lib.d.ts","../b.ts"],"fileInfos":[{"version":"8859c12c614ce56ba9a18e58384a198f-/// \ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array { length: number; [n: number]: T; }\ninterface ReadonlyArray {}\ninterface SymbolConstructor {\n (desc?: string | number): symbol;\n for(name: string): symbol;\n readonly toStringTag: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\ninterface Symbol {\n readonly [Symbol.toStringTag]: string;\n}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true,"impliedNodeFormat":1},{"version":"fcbf49879e154aae077c688a18cd60c0-import { m } from '../alpha/a'","signature":"abe7d9981d6018efb6b2b794f40a1607-export {};\n","impliedNodeFormat":1}],"options":{"composite":true,"outDir":"./"},"semanticDiagnosticsPerFile":[[2,[{"pos":18,"end":30,"code":6305,"category":1,"message":"Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'."}]]],"latestChangedDtsFile":"./b.d.ts"} //// [/home/src/workspaces/project/beta/bin/tsconfig.tsbuildinfo.readable.baseline.txt] *new* { "version": "FakeTSVersion", - "errors": true, "root": [ { "files": [ @@ -111,16 +110,26 @@ Object.defineProperty(exports, "__esModule", { value: true }); "outDir": "./" }, "semanticDiagnosticsPerFile": [ - "lib.d.ts", - "../b.ts" + [ + "../b.ts", + [ + { + "pos": 18, + "end": 30, + "code": 6305, + "category": 1, + "message": "Output file '/home/src/workspaces/project/alpha/bin/a.d.ts' has not been built from source file '/home/src/workspaces/project/alpha/a.ts'." + } + ] + ] ], "latestChangedDtsFile": "./b.d.ts", - "size": 1143 + "size": 1327 } beta/tsconfig.json:: SemanticDiagnostics:: -*not cached* /home/src/tslibs/TS/Lib/lib.d.ts -*not cached* /home/src/workspaces/project/beta/b.ts +*refresh* /home/src/tslibs/TS/Lib/lib.d.ts +*refresh* /home/src/workspaces/project/beta/b.ts Signatures:: (stored at emit) /home/src/workspaces/project/beta/b.ts diff --git a/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js b/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js index 508fa2d280..b7ebae5101 100644 --- a/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js +++ b/testdata/baselines/reference/tsc/projectReferences/when-project-reference-is-not-built.js @@ -21,10 +21,10 @@ export const x = 10; tsgo --p project ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -project/index.ts:1:1 - error TS6053: File '/home/src/workspaces/solution/utils/index.d.ts' not found. +project/index.ts:1:19 - error TS6305: Output file '/home/src/workspaces/solution/utils/index.d.ts' has not been built from source file '/home/src/workspaces/solution/utils/index.ts'. 1 import { x } from "../utils"; -  ~ +   ~~~~~~~~~~ Found 1 error in project/index.ts:1 diff --git a/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js b/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js index 514822a22e..38e6f71d13 100644 --- a/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js +++ b/testdata/baselines/reference/tsc/projectReferences/when-project-references-composite-project-with-noEmit.js @@ -22,22 +22,13 @@ export const x = 10; tsgo --p project ExitStatus:: DiagnosticsPresent_OutputsGenerated Output:: -project/index.ts:1:1 - error TS6053: File '/home/src/workspaces/solution/utils/index.d.ts' not found. - -1 import { x } from "../utils"; -  ~ - project/tsconfig.json:3:9 - error TS6310: Referenced project '/home/src/workspaces/solution/utils' may not disable emit. 3 { "path": "../utils" },    ~~~~~~~~~~~~~~~~~~~~~~ -Found 2 errors in 2 files. - -Errors Files - 1 project/index.ts:1 - 1 project/tsconfig.json:3 +Found 1 error in project/tsconfig.json:3 //// [/home/src/tslibs/TS/Lib/lib.d.ts] *Lib* /// From 1dddca1355759ee2e0c771c81063e94950f7f003 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 11:17:34 +0000 Subject: [PATCH 14/22] failed tests --- internal/compiler/fileloader.go | 4 +-- internal/compiler/program.go | 57 ++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index 62e696315a..f29e8eef46 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -52,7 +52,7 @@ type fileLoader struct { } type missingFile struct { - path string + path tspath.Path reason *FileIncludeReason } @@ -177,7 +177,7 @@ func processAllProgramFiles( // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { missingFiles = append(missingFiles, missingFile{ - path: task.normalizedFilePath, + path: task.path, reason: task.includeReason, }) return diff --git a/internal/compiler/program.go b/internal/compiler/program.go index d0bccfe7e5..d95d2d6afd 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1224,33 +1224,54 @@ func (p *Program) getDiagnosticsHelper(ctx context.Context, sourceFile *ast.Sour } func (p *Program) addProgramDiagnostics() { - for _, m := range p.missingFiles { - reason := m.reason - data, ok := reason.data.(*referencedFileData) + for _, missingFile := range p.missingFiles { + missingFileReason := missingFile.reason + refData, ok := missingFileReason.data.(*referencedFileData) if !ok { continue } - parent := p.filesByPath[data.file] - if parent == nil { + parentFile := p.filesByPath[refData.file] + if parentFile == nil { continue } - ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { - return r.FileName == m.path - }) - if ref == nil { - continue + // ref := core.Find(parentFile.ReferencedFiles, func(r *ast.FileReference) bool { + // // refPath := tspath.Join(parent., r.FileName) // make it absolute + // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) + // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) + // }) + + for _, ref := range parentFile.ReferencedFiles { + if ref.FileName == missingFile.path { + diagnostic := ast.NewDiagnostic( + parentFile, + ref.TextRange, + diagnostics.File_0_not_found, + missingFile.path, + ) + p.programDiagnostics = append(p.programDiagnostics, diagnostic) + } } - diagnostic := ast.NewDiagnostic( - parent, - ref.TextRange, - diagnostics.File_0_not_found, - m.path, - ) + // ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { + // // refPath := tspath.Join(parent., r.FileName) // make it absolute + // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) + // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) + // }) + + // if ref == nil { + // continue + // } + + // diagnostic := ast.NewDiagnostic( + // parent, + // ref.TextRange, + // diagnostics.File_0_not_found, + // m.path, + // ) - p.programDiagnostics = append(p.programDiagnostics, diagnostic) + // p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } @@ -1586,7 +1607,7 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { return slices.ContainsFunc(p.missingFiles, func(missingPath missingFile) bool { - return p.toPath(missingPath.path) == path + return missingPath.path == path }) } From f4eddf61efd7ff6518278c90e3470a59637d538f Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 11:19:12 +0000 Subject: [PATCH 15/22] failed incremental test --- main.js | 4 ++++ main.ts | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 main.js create mode 100644 main.ts diff --git a/main.js b/main.js new file mode 100644 index 0000000000..3b986f61ab --- /dev/null +++ b/main.js @@ -0,0 +1,4 @@ +// @declaration: true +// @noresolve: true +/// +var x = 0; diff --git a/main.ts b/main.ts new file mode 100644 index 0000000000..3b986f61ab --- /dev/null +++ b/main.ts @@ -0,0 +1,4 @@ +// @declaration: true +// @noresolve: true +/// +var x = 0; From 3ebb7532dbb1e58064691a2a4e2e5779547fb8ae Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 20:53:52 +0000 Subject: [PATCH 16/22] update new baseline --- internal/compiler/fileloader.go | 4 +- internal/compiler/program.go | 23 +- ...declarationEmitInvalidReference.errors.txt | 8 + ...eclarationEmitInvalidReference2.errors.txt | 8 + ...tionEmitInvalidReferenceAllowJs.errors.txt | 9 + .../fileReferencesWithNoExtensions.errors.txt | 31 ++ .../invalidTripleSlashReference.errors.txt | 14 + .../conformance/parserRealSource1.errors.txt | 160 ++++++++++ .../conformance/parserRealSource10.errors.txt | 5 +- .../conformance/parserRealSource11.errors.txt | 5 +- .../conformance/parserRealSource12.errors.txt | 5 +- .../conformance/parserRealSource13.errors.txt | 5 +- .../conformance/parserRealSource14.errors.txt | 5 +- .../conformance/parserRealSource2.errors.txt | 277 ++++++++++++++++++ .../conformance/parserRealSource3.errors.txt | 125 ++++++++ .../conformance/parserRealSource4.errors.txt | 5 +- .../conformance/parserRealSource5.errors.txt | 5 +- .../conformance/parserRealSource6.errors.txt | 5 +- .../conformance/parserRealSource7.errors.txt | 5 +- .../conformance/parserRealSource8.errors.txt | 5 +- .../conformance/parserRealSource9.errors.txt | 5 +- .../conformance/parserharness.errors.txt | 5 +- .../conformance/parserindenter.errors.txt | 5 +- .../conformance/scannertest1.errors.txt | 5 +- 24 files changed, 692 insertions(+), 37 deletions(-) create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt create mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt create mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index f29e8eef46..62e696315a 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -52,7 +52,7 @@ type fileLoader struct { } type missingFile struct { - path tspath.Path + path string reason *FileIncludeReason } @@ -177,7 +177,7 @@ func processAllProgramFiles( // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { missingFiles = append(missingFiles, missingFile{ - path: task.path, + path: task.normalizedFilePath, reason: task.includeReason, }) return diff --git a/internal/compiler/program.go b/internal/compiler/program.go index d95d2d6afd..8069c4f1b2 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1243,7 +1243,7 @@ func (p *Program) addProgramDiagnostics() { // }) for _, ref := range parentFile.ReferencedFiles { - if ref.FileName == missingFile.path { + if ref.FileName == tspath.GetBaseFileName(missingFile.path) { diagnostic := ast.NewDiagnostic( parentFile, ref.TextRange, @@ -1253,25 +1253,6 @@ func (p *Program) addProgramDiagnostics() { p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } - - // ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { - // // refPath := tspath.Join(parent., r.FileName) // make it absolute - // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) - // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) - // }) - - // if ref == nil { - // continue - // } - - // diagnostic := ast.NewDiagnostic( - // parent, - // ref.TextRange, - // diagnostics.File_0_not_found, - // m.path, - // ) - - // p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } @@ -1607,7 +1588,7 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { return slices.ContainsFunc(p.missingFiles, func(missingPath missingFile) bool { - return missingPath.path == path + return missingPath.path == string(path) }) } diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt new file mode 100644 index 0000000000..3410b755ed --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt @@ -0,0 +1,8 @@ +declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. + + +==== declarationEmitInvalidReference.ts (1 errors) ==== + /// + ~~~~~~~~~~ +!!! error TS6053: File 'invalid.ts' not found. + var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt new file mode 100644 index 0000000000..ab08b44a07 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt @@ -0,0 +1,8 @@ +declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. + + +==== declarationEmitInvalidReference2.ts (1 errors) ==== + /// + ~~~~~~~~~~ +!!! error TS6053: File 'invalid.ts' not found. + var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt new file mode 100644 index 0000000000..901eb88671 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt @@ -0,0 +1,9 @@ +declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. + + +==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== + /// + ~~~~~~~ +!!! error TS6053: File 'invalid' not found. + var x = 0; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt new file mode 100644 index 0000000000..e90dfea033 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt @@ -0,0 +1,31 @@ +t.ts(1,22): error TS6053: File 'a' not found. +t.ts(2,22): error TS6053: File 'b' not found. +t.ts(3,22): error TS6053: File 'c' not found. + + +==== t.ts (3 errors) ==== + /// + ~ +!!! error TS6053: File 'a' not found. + /// + ~ +!!! error TS6053: File 'b' not found. + /// + ~ +!!! error TS6053: File 'c' not found. + var a = aa; // Check that a.ts is referenced + var b = bb; // Check that b.d.ts is referenced + var c = cc; // Check that c.ts has precedence over c.d.ts + +==== a.ts (0 errors) ==== + var aa = 1; + +==== b.d.ts (0 errors) ==== + declare var bb: number; + +==== c.ts (0 errors) ==== + var cc = 1; + +==== c.d.ts (0 errors) ==== + declare var xx: number; + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt new file mode 100644 index 0000000000..ee64719ef0 --- /dev/null +++ b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt @@ -0,0 +1,14 @@ +invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. +invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. + + +==== invalidTripleSlashReference.ts (2 errors) ==== + /// + ~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File 'filedoesnotexist.ts' not found. + /// + ~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. + + // this test doesn't actually give the errors you want due to the way the compiler reports errors + var x = 1; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt new file mode 100644 index 0000000000..e7d69ba104 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt @@ -0,0 +1,160 @@ +parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource1.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + export module CompilerDiagnostics { + export var debug = false; + export interface IDiagnosticWriter { + Alert(output: string): void; + } + + export var diagnosticWriter: IDiagnosticWriter = null; + + export var analysisPass: number = 0; + + export function Alert(output: string) { + if (diagnosticWriter) { + diagnosticWriter.Alert(output); + } + } + + export function debugPrint(s: string) { + if (debug) { + Alert(s); + } + } + + export function assert(condition: boolean, s: string) { + if (debug) { + if (!condition) { + Alert(s); + } + } + } + + } + + export interface ILogger { + information(): boolean; + debug(): boolean; + warning(): boolean; + error(): boolean; + fatal(): boolean; + log(s: string): void; + } + + export class NullLogger implements ILogger { + public information(): boolean { return false; } + public debug(): boolean { return false; } + public warning(): boolean { return false; } + public error(): boolean { return false; } + public fatal(): boolean { return false; } + public log(s: string): void { + } + } + + export class LoggerAdapter implements ILogger { + private _information: boolean; + private _debug: boolean; + private _warning: boolean; + private _error: boolean; + private _fatal: boolean; + + constructor (public logger: ILogger) { + this._information = this.logger.information(); + this._debug = this.logger.debug(); + this._warning = this.logger.warning(); + this._error = this.logger.error(); + this._fatal = this.logger.fatal(); + } + + + public information(): boolean { return this._information; } + public debug(): boolean { return this._debug; } + public warning(): boolean { return this._warning; } + public error(): boolean { return this._error; } + public fatal(): boolean { return this._fatal; } + public log(s: string): void { + this.logger.log(s); + } + } + + export class BufferedLogger implements ILogger { + public logContents = []; + + public information(): boolean { return false; } + public debug(): boolean { return false; } + public warning(): boolean { return false; } + public error(): boolean { return false; } + public fatal(): boolean { return false; } + public log(s: string): void { + this.logContents.push(s); + } + } + + export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { + var start = +new Date(); + var result = func(); + var end = +new Date(); + logger.log(funcDescription + " completed in " + (end - start) + " msec"); + return result; + } + + export function stringToLiteral(value: string, length: number): string { + var result = ""; + + var addChar = (index: number) => { + var ch = value.charCodeAt(index); + switch (ch) { + case 0x09: // tab + result += "\\t"; + break; + case 0x0a: // line feed + result += "\\n"; + break; + case 0x0b: // vertical tab + result += "\\v"; + break; + case 0x0c: // form feed + result += "\\f"; + break; + case 0x0d: // carriage return + result += "\\r"; + break; + case 0x22: // double quote + result += "\\\""; + break; + case 0x27: // single quote + result += "\\\'"; + break; + case 0x5c: // Backslash + result += "\\"; + break; + default: + result += value.charAt(index); + } + } + + var tooLong = (value.length > length); + if (tooLong) { + var mid = length >> 1; + for (var i = 0; i < mid; i++) addChar(i); + result += "(...)"; + for (var i = value.length - mid; i < value.length; i++) addChar(i); + } + else { + length = value.length; + for (var i = 0; i < length; i++) addChar(i); + } + return result; + } + } + \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt index d910c1c159..e0e0ea045a 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt @@ -1,3 +1,4 @@ +parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -342,11 +343,13 @@ parserRealSource10.ts(356,53): error TS2304: Cannot find name 'NodeType'. parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. -==== parserRealSource10.ts (342 errors) ==== +==== parserRealSource10.ts (343 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export enum TokenID { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt index 301c863fe3..4584962cc2 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt @@ -1,3 +1,4 @@ +parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -510,11 +511,13 @@ parserRealSource11.ts(2356,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== parserRealSource11.ts (510 errors) ==== +==== parserRealSource11.ts (511 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class ASTSpan { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt index 469eb6ebc9..65f0af9317 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt @@ -1,3 +1,4 @@ +parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. @@ -208,11 +209,13 @@ parserRealSource12.ts(523,88): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. -==== parserRealSource12.ts (208 errors) ==== +==== parserRealSource12.ts (209 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export interface IAstWalker { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt index edd2adfa16..45a111a3a4 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt @@ -1,3 +1,4 @@ +parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. @@ -115,11 +116,13 @@ parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? -==== parserRealSource13.ts (115 errors) ==== +==== parserRealSource13.ts (116 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { export interface AstWalkerDetailCallback { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt index cee28fce0c..417b0c7c6b 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt @@ -1,3 +1,4 @@ +parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. @@ -159,11 +160,13 @@ parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no expor parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource14.ts (159 errors) ==== +==== parserRealSource14.ts (160 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export function lastOf(items: any[]): any { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt new file mode 100644 index 0000000000..fe21785dbd --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt @@ -0,0 +1,277 @@ +parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource2.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + + export function hasFlag(val: number, flag: number) { + return (val & flag) != 0; + } + + export enum ErrorRecoverySet { + None = 0, + Comma = 1, // Comma + SColon = 1 << 1, // SColon + Asg = 1 << 2, // Asg + BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv + // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, + // Pct, GT, LT, And, Xor, Or + RBrack = 1 << 4, // RBrack + RCurly = 1 << 5, // RCurly + RParen = 1 << 6, // RParen + Dot = 1 << 7, // Dot + Colon = 1 << 8, // Colon + PrimType = 1 << 9, // number, string, boolean + AddOp = 1 << 10, // Add, Sub + LCurly = 1 << 11, // LCurly + PreOp = 1 << 12, // Tilde, Bang, Inc, Dec + RegExp = 1 << 13, // RegExp + LParen = 1 << 14, // LParen + LBrack = 1 << 15, // LBrack + Scope = 1 << 16, // Scope + In = 1 << 17, // IN + SCase = 1 << 18, // CASE, DEFAULT + Else = 1 << 19, // ELSE + Catch = 1 << 20, // CATCH, FINALLY + Var = 1 << 21, // + Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH + While = 1 << 23, // WHILE + ID = 1 << 24, // ID + Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT + Literal = 1 << 26, // IntCon, FltCon, StrCon + RLit = 1 << 27, // THIS, TRUE, FALSE, NULL + Func = 1 << 28, // FUNCTION + EOF = 1 << 29, // EOF + + // REVIEW: Name this something clearer. + TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT + ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, + StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, + Postfix = Dot | LParen | LBrack, + } + + export enum AllowedElements { + None = 0, + ModuleDeclarations = 1 << 2, + ClassDeclarations = 1 << 3, + InterfaceDeclarations = 1 << 4, + AmbientDeclarations = 1 << 10, + Properties = 1 << 11, + + Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, + QuickParse = Global | Properties, + } + + export enum Modifiers { + None = 0, + Private = 1, + Public = 1 << 1, + Readonly = 1 << 2, + Ambient = 1 << 3, + Exported = 1 << 4, + Getter = 1 << 5, + Setter = 1 << 6, + Static = 1 << 7, + } + + export enum ASTFlags { + None = 0, + ExplicitSemicolon = 1, // statment terminated by an explicit semicolon + AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon + Writeable = 1 << 2, // node is lhs that can be modified + Error = 1 << 3, // node has an error + DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor + DotLHS = 1 << 5, // node is the lhs of a dot expr + IsStatement = 1 << 6, // node is a statement + StrictMode = 1 << 7, // node is in the strict mode environment + PossibleOptionalParameter = 1 << 8, + ClassBaseConstructorCall = 1 << 9, + OptionalName = 1 << 10, + // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. + // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. + // Once we have a better way to associate information with nodes, this flag should not be used. + SkipNextRParen = 1 << 11, + } + + export enum DeclFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + } + + export enum ModuleFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + IsEnum = 1 << 8, + ShouldEmitModuleDecl = 1 << 9, + IsWholeFile = 1 << 10, + IsDynamic = 1 << 11, + MustCaptureThis = 1 << 12, + } + + export enum SymbolFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + Property = 1 << 8, + Readonly = 1 << 9, + ModuleMember = 1 << 10, + InterfaceMember = 1 << 11, + ClassMember = 1 << 12, + BuiltIn = 1 << 13, + TypeSetDuringScopeAssignment = 1 << 14, + Constant = 1 << 15, + Optional = 1 << 16, + RecursivelyReferenced = 1 << 17, + Bound = 1 << 18, + CompilerGenerated = 1 << 19, + } + + export enum VarFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + AutoInit = 1 << 8, + Property = 1 << 9, + Readonly = 1 << 10, + Class = 1 << 11, + ClassProperty = 1 << 12, + ClassBodyProperty = 1 << 13, + ClassConstructorProperty = 1 << 14, + ClassSuperMustBeFirstCallInConstructor = 1 << 15, + Constant = 1 << 16, + MustCaptureThis = 1 << 17, + } + + export enum FncFlags { + None = 0, + Exported = 1, + Private = 1 << 1, + Public = 1 << 2, + Ambient = 1 << 3, + Static = 1 << 4, + LocalStatic = 1 << 5, + GetAccessor = 1 << 6, + SetAccessor = 1 << 7, + Definition = 1 << 8, + Signature = 1 << 9, + Method = 1 << 10, + HasReturnExpression = 1 << 11, + CallMember = 1 << 12, + ConstructMember = 1 << 13, + HasSelfReference = 1 << 14, + IsFatArrowFunction = 1 << 15, + IndexerMember = 1 << 16, + IsFunctionExpression = 1 << 17, + ClassMethod = 1 << 18, + ClassPropertyMethodExported = 1 << 19, + } + + export enum SignatureFlags { + None = 0, + IsIndexer = 1, + IsStringIndexer = 1 << 1, + IsNumberIndexer = 1 << 2, + } + + export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; + export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; + export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; + export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; + export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { + return fncOrVarOrSymbolOrModuleFlags; + } + + export enum TypeFlags { + None = 0, + HasImplementation = 1, + HasSelfReference = 1 << 1, + MergeResult = 1 << 2, + IsEnum = 1 << 3, + BuildingName = 1 << 4, + HasBaseType = 1 << 5, + HasBaseTypeOfObject = 1 << 6, + IsClass = 1 << 7, + } + + export enum TypeRelationshipFlags { + SuccessfulComparison = 0, + SourceIsNullTargetIsVoidOrUndefined = 1, + RequiredPropertyIsMissing = 1 << 1, + IncompatibleSignatures = 1 << 2, + SourceSignatureHasTooManyParameters = 3, + IncompatibleReturnTypes = 1 << 4, + IncompatiblePropertyTypes = 1 << 5, + IncompatibleParameterTypes = 1 << 6, + } + + export enum CodeGenTarget { + ES3 = 0, + ES5 = 1, + } + + export enum ModuleGenTarget { + Synchronous = 0, + Asynchronous = 1, + Local = 1 << 1, + } + + // Compiler defaults to generating ES5-compliant code for + // - getters and setters + export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; + + export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; + + export var optimizeModuleCodeGen = true; + + export function flagsToString(e, flags: number): string { + var builder = ""; + for (var i = 1; i < (1 << 31) ; i = i << 1) { + if ((flags & i) != 0) { + for (var k in e) { + if (e[k] == i) { + if (builder.length > 0) { + builder += "|"; + } + builder += k; + break; + } + } + } + } + return builder; + } + + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt new file mode 100644 index 0000000000..ad9c1f9ac6 --- /dev/null +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt @@ -0,0 +1,125 @@ +parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. + + +==== parserRealSource3.ts (1 errors) ==== + // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. + // See LICENSE.txt in the project root for complete license information. + + /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. + + module TypeScript { + // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback + export enum NodeType { + None, + Empty, + EmptyExpr, + True, + False, + This, + Super, + QString, + Regex, + Null, + ArrayLit, + ObjectLit, + Void, + Comma, + Pos, + Neg, + Delete, + Await, + In, + Dot, + From, + Is, + InstOf, + Typeof, + NumberLit, + Name, + TypeRef, + Index, + Call, + New, + Asg, + AsgAdd, + AsgSub, + AsgDiv, + AsgMul, + AsgMod, + AsgAnd, + AsgXor, + AsgOr, + AsgLsh, + AsgRsh, + AsgRs2, + ConditionalExpression, + LogOr, + LogAnd, + Or, + Xor, + And, + Eq, + Ne, + Eqv, + NEqv, + Lt, + Le, + Gt, + Ge, + Add, + Sub, + Mul, + Div, + Mod, + Lsh, + Rsh, + Rs2, + Not, + LogNot, + IncPre, + DecPre, + IncPost, + DecPost, + TypeAssertion, + FuncDecl, + Member, + VarDecl, + ArgDecl, + Return, + Break, + Continue, + Throw, + For, + ForIn, + If, + While, + DoWhile, + Block, + Case, + Switch, + Try, + TryCatch, + TryFinally, + Finally, + Catch, + List, + Script, + ClassDeclaration, + InterfaceDeclaration, + ModuleDeclaration, + ImportDeclaration, + With, + Label, + LabeledStatement, + EBStart, + GotoEB, + EndCode, + Error, + Comment, + Debugger, + GeneralNode = FuncDecl, + LastAsg = AsgRs2, + } + } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt index f3bf960e1d..d20b223402 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt @@ -1,11 +1,14 @@ +parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. -==== parserRealSource4.ts (1 errors) ==== +==== parserRealSource4.ts (2 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt index 8e13f7af9d..9166edb4e6 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt @@ -1,3 +1,4 @@ +parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. @@ -8,11 +9,13 @@ parserRealSource5.ts(61,52): error TS2304: Cannot find name 'AST'. parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. -==== parserRealSource5.ts (8 errors) ==== +==== parserRealSource5.ts (9 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { // TODO: refactor indent logic for use in emit diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt index 6d21559554..0c55b63b07 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt @@ -1,3 +1,4 @@ +parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. @@ -59,11 +60,13 @@ parserRealSource6.ts(212,81): error TS2304: Cannot find name 'ISourceText'. parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource6.ts (59 errors) ==== +==== parserRealSource6.ts (60 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class TypeCollectionContext { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt index 9103a77c23..e91833fac9 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt @@ -1,3 +1,4 @@ +parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? @@ -303,11 +304,13 @@ parserRealSource7.ts(827,34): error TS2304: Cannot find name 'NodeType'. parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. -==== parserRealSource7.ts (303 errors) ==== +==== parserRealSource7.ts (304 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Continuation { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt index 359492c310..56c4a714dc 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt @@ -1,3 +1,4 @@ +parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -129,11 +130,13 @@ parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? -==== parserRealSource8.ts (129 errors) ==== +==== parserRealSource8.ts (130 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt index dffb11e04a..9fd2058cb8 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt @@ -1,3 +1,4 @@ +parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -38,11 +39,13 @@ parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -==== parserRealSource9.ts (38 errors) ==== +==== parserRealSource9.ts (39 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Binder { diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt index 31a75354a8..478eb1cffe 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt @@ -1,3 +1,4 @@ +parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. @@ -106,7 +107,7 @@ parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? -==== parserharness.ts (106 errors) ==== +==== parserharness.ts (107 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -126,6 +127,8 @@ parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean ' /// /// /// + ~~~~~~~ +!!! error TS6053: File 'diff.ts' not found. declare var assert: Harness.Assert; ~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt index c3eb8c504f..ecef6e2a1d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt @@ -1,3 +1,4 @@ +parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -127,7 +128,7 @@ parserindenter.ts(735,42): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. -==== parserindenter.ts (127 errors) ==== +==== parserindenter.ts (128 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -144,6 +145,8 @@ parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. // /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'formatting.ts' not found. module Formatting { diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt index ca1c2ae9a6..833098432b 100644 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt @@ -1,3 +1,4 @@ +scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? @@ -15,8 +16,10 @@ scannertest1.ts(19,23): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. -==== scannertest1.ts (15 errors) ==== +==== scannertest1.ts (16 errors) ==== /// + ~~~~~~~~~~~~~ +!!! error TS6053: File 'References.ts' not found. class CharacterInfo { public static isDecimalDigit(c: number): boolean { From a8a4b3cdf62a06732b268594a6b742ca5c03b7e0 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 22:32:17 +0000 Subject: [PATCH 17/22] fix --- internal/compiler/program.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 8069c4f1b2..31fcdbdf88 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1236,14 +1236,8 @@ func (p *Program) addProgramDiagnostics() { continue } - // ref := core.Find(parentFile.ReferencedFiles, func(r *ast.FileReference) bool { - // // refPath := tspath.Join(parent., r.FileName) // make it absolute - // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) - // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) - // }) - for _, ref := range parentFile.ReferencedFiles { - if ref.FileName == tspath.GetBaseFileName(missingFile.path) { + if tspath.GetNormalizedAbsolutePath(ref.FileName, tspath.GetDirectoryPath(parentFile.FileName())) == missingFile.path { diagnostic := ast.NewDiagnostic( parentFile, ref.TextRange, From 5af31f1dc645acaeaea668615c5d81a74a3be9f2 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 22:32:26 +0000 Subject: [PATCH 18/22] Revert "failed incremental test" This reverts commit f4eddf61efd7ff6518278c90e3470a59637d538f. --- main.js | 4 ---- main.ts | 4 ---- 2 files changed, 8 deletions(-) delete mode 100644 main.js delete mode 100644 main.ts diff --git a/main.js b/main.js deleted file mode 100644 index 3b986f61ab..0000000000 --- a/main.js +++ /dev/null @@ -1,4 +0,0 @@ -// @declaration: true -// @noresolve: true -/// -var x = 0; diff --git a/main.ts b/main.ts deleted file mode 100644 index 3b986f61ab..0000000000 --- a/main.ts +++ /dev/null @@ -1,4 +0,0 @@ -// @declaration: true -// @noresolve: true -/// -var x = 0; From c29d72959980e165537aca727676fcf764f3d912 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 22:36:39 +0000 Subject: [PATCH 19/22] Revert "update new baseline" This reverts commit 3ebb7532dbb1e58064691a2a4e2e5779547fb8ae. --- ...declarationEmitInvalidReference.errors.txt | 8 - ...eclarationEmitInvalidReference2.errors.txt | 8 - ...tionEmitInvalidReferenceAllowJs.errors.txt | 9 - .../fileReferencesWithNoExtensions.errors.txt | 31 -- .../invalidTripleSlashReference.errors.txt | 14 - .../conformance/parserRealSource1.errors.txt | 160 ---------- .../conformance/parserRealSource10.errors.txt | 5 +- .../conformance/parserRealSource11.errors.txt | 5 +- .../conformance/parserRealSource12.errors.txt | 5 +- .../conformance/parserRealSource13.errors.txt | 5 +- .../conformance/parserRealSource14.errors.txt | 5 +- .../conformance/parserRealSource2.errors.txt | 277 ------------------ .../conformance/parserRealSource3.errors.txt | 125 -------- .../conformance/parserRealSource4.errors.txt | 5 +- .../conformance/parserRealSource5.errors.txt | 5 +- .../conformance/parserRealSource6.errors.txt | 5 +- .../conformance/parserRealSource7.errors.txt | 5 +- .../conformance/parserRealSource8.errors.txt | 5 +- .../conformance/parserRealSource9.errors.txt | 5 +- .../conformance/parserharness.errors.txt | 5 +- .../conformance/parserindenter.errors.txt | 5 +- .../conformance/scannertest1.errors.txt | 5 +- 22 files changed, 14 insertions(+), 688 deletions(-) delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt delete mode 100644 testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt delete mode 100644 testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt deleted file mode 100644 index 3410b755ed..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -declarationEmitInvalidReference.ts(1,22): error TS6053: File 'invalid.ts' not found. - - -==== declarationEmitInvalidReference.ts (1 errors) ==== - /// - ~~~~~~~~~~ -!!! error TS6053: File 'invalid.ts' not found. - var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt deleted file mode 100644 index ab08b44a07..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReference2.errors.txt +++ /dev/null @@ -1,8 +0,0 @@ -declarationEmitInvalidReference2.ts(1,22): error TS6053: File 'invalid.ts' not found. - - -==== declarationEmitInvalidReference2.ts (1 errors) ==== - /// - ~~~~~~~~~~ -!!! error TS6053: File 'invalid.ts' not found. - var x = 0; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt b/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt deleted file mode 100644 index 901eb88671..0000000000 --- a/testdata/baselines/reference/submodule/compiler/declarationEmitInvalidReferenceAllowJs.errors.txt +++ /dev/null @@ -1,9 +0,0 @@ -declarationEmitInvalidReferenceAllowJs.ts(1,22): error TS6053: File 'invalid' not found. - - -==== declarationEmitInvalidReferenceAllowJs.ts (1 errors) ==== - /// - ~~~~~~~ -!!! error TS6053: File 'invalid' not found. - var x = 0; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt b/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt deleted file mode 100644 index e90dfea033..0000000000 --- a/testdata/baselines/reference/submodule/compiler/fileReferencesWithNoExtensions.errors.txt +++ /dev/null @@ -1,31 +0,0 @@ -t.ts(1,22): error TS6053: File 'a' not found. -t.ts(2,22): error TS6053: File 'b' not found. -t.ts(3,22): error TS6053: File 'c' not found. - - -==== t.ts (3 errors) ==== - /// - ~ -!!! error TS6053: File 'a' not found. - /// - ~ -!!! error TS6053: File 'b' not found. - /// - ~ -!!! error TS6053: File 'c' not found. - var a = aa; // Check that a.ts is referenced - var b = bb; // Check that b.d.ts is referenced - var c = cc; // Check that c.ts has precedence over c.d.ts - -==== a.ts (0 errors) ==== - var aa = 1; - -==== b.d.ts (0 errors) ==== - declare var bb: number; - -==== c.ts (0 errors) ==== - var cc = 1; - -==== c.d.ts (0 errors) ==== - declare var xx: number; - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt b/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt deleted file mode 100644 index ee64719ef0..0000000000 --- a/testdata/baselines/reference/submodule/compiler/invalidTripleSlashReference.errors.txt +++ /dev/null @@ -1,14 +0,0 @@ -invalidTripleSlashReference.ts(1,22): error TS6053: File 'filedoesnotexist.ts' not found. -invalidTripleSlashReference.ts(2,22): error TS6053: File 'otherdoesnotexist.d.ts' not found. - - -==== invalidTripleSlashReference.ts (2 errors) ==== - /// - ~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'filedoesnotexist.ts' not found. - /// - ~~~~~~~~~~~~~~~~~~~~~~ -!!! error TS6053: File 'otherdoesnotexist.d.ts' not found. - - // this test doesn't actually give the errors you want due to the way the compiler reports errors - var x = 1; \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt deleted file mode 100644 index e7d69ba104..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource1.errors.txt +++ /dev/null @@ -1,160 +0,0 @@ -parserRealSource1.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource1.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - export module CompilerDiagnostics { - export var debug = false; - export interface IDiagnosticWriter { - Alert(output: string): void; - } - - export var diagnosticWriter: IDiagnosticWriter = null; - - export var analysisPass: number = 0; - - export function Alert(output: string) { - if (diagnosticWriter) { - diagnosticWriter.Alert(output); - } - } - - export function debugPrint(s: string) { - if (debug) { - Alert(s); - } - } - - export function assert(condition: boolean, s: string) { - if (debug) { - if (!condition) { - Alert(s); - } - } - } - - } - - export interface ILogger { - information(): boolean; - debug(): boolean; - warning(): boolean; - error(): boolean; - fatal(): boolean; - log(s: string): void; - } - - export class NullLogger implements ILogger { - public information(): boolean { return false; } - public debug(): boolean { return false; } - public warning(): boolean { return false; } - public error(): boolean { return false; } - public fatal(): boolean { return false; } - public log(s: string): void { - } - } - - export class LoggerAdapter implements ILogger { - private _information: boolean; - private _debug: boolean; - private _warning: boolean; - private _error: boolean; - private _fatal: boolean; - - constructor (public logger: ILogger) { - this._information = this.logger.information(); - this._debug = this.logger.debug(); - this._warning = this.logger.warning(); - this._error = this.logger.error(); - this._fatal = this.logger.fatal(); - } - - - public information(): boolean { return this._information; } - public debug(): boolean { return this._debug; } - public warning(): boolean { return this._warning; } - public error(): boolean { return this._error; } - public fatal(): boolean { return this._fatal; } - public log(s: string): void { - this.logger.log(s); - } - } - - export class BufferedLogger implements ILogger { - public logContents = []; - - public information(): boolean { return false; } - public debug(): boolean { return false; } - public warning(): boolean { return false; } - public error(): boolean { return false; } - public fatal(): boolean { return false; } - public log(s: string): void { - this.logContents.push(s); - } - } - - export function timeFunction(logger: ILogger, funcDescription: string, func: () =>any): any { - var start = +new Date(); - var result = func(); - var end = +new Date(); - logger.log(funcDescription + " completed in " + (end - start) + " msec"); - return result; - } - - export function stringToLiteral(value: string, length: number): string { - var result = ""; - - var addChar = (index: number) => { - var ch = value.charCodeAt(index); - switch (ch) { - case 0x09: // tab - result += "\\t"; - break; - case 0x0a: // line feed - result += "\\n"; - break; - case 0x0b: // vertical tab - result += "\\v"; - break; - case 0x0c: // form feed - result += "\\f"; - break; - case 0x0d: // carriage return - result += "\\r"; - break; - case 0x22: // double quote - result += "\\\""; - break; - case 0x27: // single quote - result += "\\\'"; - break; - case 0x5c: // Backslash - result += "\\"; - break; - default: - result += value.charAt(index); - } - } - - var tooLong = (value.length > length); - if (tooLong) { - var mid = length >> 1; - for (var i = 0; i < mid; i++) addChar(i); - result += "(...)"; - for (var i = value.length - mid; i < value.length; i++) addChar(i); - } - else { - length = value.length; - for (var i = 0; i < length; i++) addChar(i); - } - return result; - } - } - \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt index e0e0ea045a..d910c1c159 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource10.errors.txt @@ -1,4 +1,3 @@ -parserRealSource10.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource10.ts(127,33): error TS2449: Class 'TokenInfo' used before its declaration. parserRealSource10.ts(127,43): error TS1011: An element access expression should take an argument. parserRealSource10.ts(128,36): error TS2693: 'string' only refers to a type, but is being used as a value here. @@ -343,13 +342,11 @@ parserRealSource10.ts(356,53): error TS2304: Cannot find name 'NodeType'. parserRealSource10.ts(449,41): error TS1011: An element access expression should take an argument. -==== parserRealSource10.ts (343 errors) ==== +==== parserRealSource10.ts (342 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export enum TokenID { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt index 4584962cc2..301c863fe3 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource11.errors.txt @@ -1,4 +1,3 @@ -parserRealSource11.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource11.ts(13,22): error TS2304: Cannot find name 'Type'. parserRealSource11.ts(14,24): error TS2304: Cannot find name 'ASTFlags'. parserRealSource11.ts(17,38): error TS2304: Cannot find name 'CompilerDiagnostics'. @@ -511,13 +510,11 @@ parserRealSource11.ts(2356,30): error TS2304: Cannot find name 'Emitter'. parserRealSource11.ts(2356,48): error TS2304: Cannot find name 'TokenID'. -==== parserRealSource11.ts (511 errors) ==== +==== parserRealSource11.ts (510 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class ASTSpan { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt index 65f0af9317..469eb6ebc9 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource12.errors.txt @@ -1,4 +1,3 @@ -parserRealSource12.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource12.ts(8,19): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,32): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(8,38): error TS2304: Cannot find name 'AST'. @@ -209,13 +208,11 @@ parserRealSource12.ts(523,88): error TS2304: Cannot find name 'AST'. parserRealSource12.ts(524,30): error TS2304: Cannot find name 'ASTList'. -==== parserRealSource12.ts (209 errors) ==== +==== parserRealSource12.ts (208 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export interface IAstWalker { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt index 45a111a3a4..edd2adfa16 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource13.errors.txt @@ -1,4 +1,3 @@ -parserRealSource13.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource13.ts(8,35): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(9,39): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(10,34): error TS2304: Cannot find name 'AST'. @@ -116,13 +115,11 @@ parserRealSource13.ts(132,51): error TS2304: Cannot find name 'AST'. parserRealSource13.ts(135,36): error TS2552: Cannot find name 'NodeType'. Did you mean 'nodeType'? -==== parserRealSource13.ts (116 errors) ==== +==== parserRealSource13.ts (115 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript.AstWalkerWithDetailCallback { export interface AstWalkerDetailCallback { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt index 417b0c7c6b..cee28fce0c 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource14.errors.txt @@ -1,4 +1,3 @@ -parserRealSource14.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource14.ts(24,33): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(38,34): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. parserRealSource14.ts(48,37): error TS2694: Namespace 'TypeScript' has no exported member 'AST'. @@ -160,13 +159,11 @@ parserRealSource14.ts(565,94): error TS2694: Namespace 'TypeScript' has no expor parserRealSource14.ts(572,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource14.ts (160 errors) ==== +==== parserRealSource14.ts (159 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export function lastOf(items: any[]): any { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt deleted file mode 100644 index fe21785dbd..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource2.errors.txt +++ /dev/null @@ -1,277 +0,0 @@ -parserRealSource2.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource2.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - - export function hasFlag(val: number, flag: number) { - return (val & flag) != 0; - } - - export enum ErrorRecoverySet { - None = 0, - Comma = 1, // Comma - SColon = 1 << 1, // SColon - Asg = 1 << 2, // Asg - BinOp = 1 << 3, // Lsh, Rsh, Rs2, Le, Ge, INSTANCEOF, EQ, NE, Eqv, NEqv, LogAnd, LogOr, AsgMul, AsgDiv - // AsgMod, AsgAdd, AsgSub, AsgLsh, AsgRsh, AsgRs2, AsgAnd, AsgXor, AsgOr, QMark, Mult, Div, - // Pct, GT, LT, And, Xor, Or - RBrack = 1 << 4, // RBrack - RCurly = 1 << 5, // RCurly - RParen = 1 << 6, // RParen - Dot = 1 << 7, // Dot - Colon = 1 << 8, // Colon - PrimType = 1 << 9, // number, string, boolean - AddOp = 1 << 10, // Add, Sub - LCurly = 1 << 11, // LCurly - PreOp = 1 << 12, // Tilde, Bang, Inc, Dec - RegExp = 1 << 13, // RegExp - LParen = 1 << 14, // LParen - LBrack = 1 << 15, // LBrack - Scope = 1 << 16, // Scope - In = 1 << 17, // IN - SCase = 1 << 18, // CASE, DEFAULT - Else = 1 << 19, // ELSE - Catch = 1 << 20, // CATCH, FINALLY - Var = 1 << 21, // - Stmt = 1 << 22, // BREAK, RETURN, THROW, DEBUGGER, FOR, SWITCH, DO, IF, TRY, WITH - While = 1 << 23, // WHILE - ID = 1 << 24, // ID - Prefix = 1 << 25, // VOID, DELETE, TYPEOF, AWAIT - Literal = 1 << 26, // IntCon, FltCon, StrCon - RLit = 1 << 27, // THIS, TRUE, FALSE, NULL - Func = 1 << 28, // FUNCTION - EOF = 1 << 29, // EOF - - // REVIEW: Name this something clearer. - TypeScriptS = 1 << 30, // PROPERTY, PRIVATE, STATIC, INTERFACE, CLASS, MODULE, EXPORT, IMPORT - ExprStart = SColon | AddOp | LCurly | PreOp | RegExp | LParen | LBrack | ID | Prefix | RLit | Func | Literal, - StmtStart = ExprStart | SColon | Var | Stmt | While | TypeScriptS, - Postfix = Dot | LParen | LBrack, - } - - export enum AllowedElements { - None = 0, - ModuleDeclarations = 1 << 2, - ClassDeclarations = 1 << 3, - InterfaceDeclarations = 1 << 4, - AmbientDeclarations = 1 << 10, - Properties = 1 << 11, - - Global = ModuleDeclarations | ClassDeclarations | InterfaceDeclarations | AmbientDeclarations, - QuickParse = Global | Properties, - } - - export enum Modifiers { - None = 0, - Private = 1, - Public = 1 << 1, - Readonly = 1 << 2, - Ambient = 1 << 3, - Exported = 1 << 4, - Getter = 1 << 5, - Setter = 1 << 6, - Static = 1 << 7, - } - - export enum ASTFlags { - None = 0, - ExplicitSemicolon = 1, // statment terminated by an explicit semicolon - AutomaticSemicolon = 1 << 1, // statment terminated by an automatic semicolon - Writeable = 1 << 2, // node is lhs that can be modified - Error = 1 << 3, // node has an error - DotLHSPartial = 1 << 4, // node is the lhs of an incomplete dot expr at cursor - DotLHS = 1 << 5, // node is the lhs of a dot expr - IsStatement = 1 << 6, // node is a statement - StrictMode = 1 << 7, // node is in the strict mode environment - PossibleOptionalParameter = 1 << 8, - ClassBaseConstructorCall = 1 << 9, - OptionalName = 1 << 10, - // REVIEW: This flag is to mark lambda nodes to note that the LParen of an expression has already been matched in the lambda header. - // The flag is used to communicate this piece of information to the calling parseTerm, which intern will remove it. - // Once we have a better way to associate information with nodes, this flag should not be used. - SkipNextRParen = 1 << 11, - } - - export enum DeclFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - } - - export enum ModuleFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - IsEnum = 1 << 8, - ShouldEmitModuleDecl = 1 << 9, - IsWholeFile = 1 << 10, - IsDynamic = 1 << 11, - MustCaptureThis = 1 << 12, - } - - export enum SymbolFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - Property = 1 << 8, - Readonly = 1 << 9, - ModuleMember = 1 << 10, - InterfaceMember = 1 << 11, - ClassMember = 1 << 12, - BuiltIn = 1 << 13, - TypeSetDuringScopeAssignment = 1 << 14, - Constant = 1 << 15, - Optional = 1 << 16, - RecursivelyReferenced = 1 << 17, - Bound = 1 << 18, - CompilerGenerated = 1 << 19, - } - - export enum VarFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - AutoInit = 1 << 8, - Property = 1 << 9, - Readonly = 1 << 10, - Class = 1 << 11, - ClassProperty = 1 << 12, - ClassBodyProperty = 1 << 13, - ClassConstructorProperty = 1 << 14, - ClassSuperMustBeFirstCallInConstructor = 1 << 15, - Constant = 1 << 16, - MustCaptureThis = 1 << 17, - } - - export enum FncFlags { - None = 0, - Exported = 1, - Private = 1 << 1, - Public = 1 << 2, - Ambient = 1 << 3, - Static = 1 << 4, - LocalStatic = 1 << 5, - GetAccessor = 1 << 6, - SetAccessor = 1 << 7, - Definition = 1 << 8, - Signature = 1 << 9, - Method = 1 << 10, - HasReturnExpression = 1 << 11, - CallMember = 1 << 12, - ConstructMember = 1 << 13, - HasSelfReference = 1 << 14, - IsFatArrowFunction = 1 << 15, - IndexerMember = 1 << 16, - IsFunctionExpression = 1 << 17, - ClassMethod = 1 << 18, - ClassPropertyMethodExported = 1 << 19, - } - - export enum SignatureFlags { - None = 0, - IsIndexer = 1, - IsStringIndexer = 1 << 1, - IsNumberIndexer = 1 << 2, - } - - export function ToDeclFlags(fncFlags: FncFlags) : DeclFlags; - export function ToDeclFlags(varFlags: VarFlags) : DeclFlags; - export function ToDeclFlags(symFlags: SymbolFlags): DeclFlags; - export function ToDeclFlags(moduleFlags: ModuleFlags): DeclFlags; - export function ToDeclFlags(fncOrVarOrSymbolOrModuleFlags: any) { - return fncOrVarOrSymbolOrModuleFlags; - } - - export enum TypeFlags { - None = 0, - HasImplementation = 1, - HasSelfReference = 1 << 1, - MergeResult = 1 << 2, - IsEnum = 1 << 3, - BuildingName = 1 << 4, - HasBaseType = 1 << 5, - HasBaseTypeOfObject = 1 << 6, - IsClass = 1 << 7, - } - - export enum TypeRelationshipFlags { - SuccessfulComparison = 0, - SourceIsNullTargetIsVoidOrUndefined = 1, - RequiredPropertyIsMissing = 1 << 1, - IncompatibleSignatures = 1 << 2, - SourceSignatureHasTooManyParameters = 3, - IncompatibleReturnTypes = 1 << 4, - IncompatiblePropertyTypes = 1 << 5, - IncompatibleParameterTypes = 1 << 6, - } - - export enum CodeGenTarget { - ES3 = 0, - ES5 = 1, - } - - export enum ModuleGenTarget { - Synchronous = 0, - Asynchronous = 1, - Local = 1 << 1, - } - - // Compiler defaults to generating ES5-compliant code for - // - getters and setters - export var codeGenTarget: CodeGenTarget = CodeGenTarget.ES3; - - export var moduleGenTarget: ModuleGenTarget = ModuleGenTarget.Synchronous; - - export var optimizeModuleCodeGen = true; - - export function flagsToString(e, flags: number): string { - var builder = ""; - for (var i = 1; i < (1 << 31) ; i = i << 1) { - if ((flags & i) != 0) { - for (var k in e) { - if (e[k] == i) { - if (builder.length > 0) { - builder += "|"; - } - builder += k; - break; - } - } - } - } - return builder; - } - - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt deleted file mode 100644 index ad9c1f9ac6..0000000000 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource3.errors.txt +++ /dev/null @@ -1,125 +0,0 @@ -parserRealSource3.ts(4,21): error TS6053: File 'typescript.ts' not found. - - -==== parserRealSource3.ts (1 errors) ==== - // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. - // See LICENSE.txt in the project root for complete license information. - - /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. - - module TypeScript { - // Note: Any addition to the NodeType should also be supported with addition to AstWalkerDetailCallback - export enum NodeType { - None, - Empty, - EmptyExpr, - True, - False, - This, - Super, - QString, - Regex, - Null, - ArrayLit, - ObjectLit, - Void, - Comma, - Pos, - Neg, - Delete, - Await, - In, - Dot, - From, - Is, - InstOf, - Typeof, - NumberLit, - Name, - TypeRef, - Index, - Call, - New, - Asg, - AsgAdd, - AsgSub, - AsgDiv, - AsgMul, - AsgMod, - AsgAnd, - AsgXor, - AsgOr, - AsgLsh, - AsgRsh, - AsgRs2, - ConditionalExpression, - LogOr, - LogAnd, - Or, - Xor, - And, - Eq, - Ne, - Eqv, - NEqv, - Lt, - Le, - Gt, - Ge, - Add, - Sub, - Mul, - Div, - Mod, - Lsh, - Rsh, - Rs2, - Not, - LogNot, - IncPre, - DecPre, - IncPost, - DecPost, - TypeAssertion, - FuncDecl, - Member, - VarDecl, - ArgDecl, - Return, - Break, - Continue, - Throw, - For, - ForIn, - If, - While, - DoWhile, - Block, - Case, - Switch, - Try, - TryCatch, - TryFinally, - Finally, - Catch, - List, - Script, - ClassDeclaration, - InterfaceDeclaration, - ModuleDeclaration, - ImportDeclaration, - With, - Label, - LabeledStatement, - EBStart, - GotoEB, - EndCode, - Error, - Comment, - Debugger, - GeneralNode = FuncDecl, - LastAsg = AsgRs2, - } - } \ No newline at end of file diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt index d20b223402..f3bf960e1d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource4.errors.txt @@ -1,14 +1,11 @@ -parserRealSource4.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource4.ts(195,38): error TS1011: An element access expression should take an argument. -==== parserRealSource4.ts (2 errors) ==== +==== parserRealSource4.ts (1 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt index 9166edb4e6..8e13f7af9d 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource5.errors.txt @@ -1,4 +1,3 @@ -parserRealSource5.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource5.ts(14,66): error TS2304: Cannot find name 'Parser'. parserRealSource5.ts(27,17): error TS2304: Cannot find name 'CompilerDiagnostics'. parserRealSource5.ts(52,38): error TS2304: Cannot find name 'AST'. @@ -9,13 +8,11 @@ parserRealSource5.ts(61,52): error TS2304: Cannot find name 'AST'. parserRealSource5.ts(61,65): error TS2304: Cannot find name 'IAstWalker'. -==== parserRealSource5.ts (9 errors) ==== +==== parserRealSource5.ts (8 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { // TODO: refactor indent logic for use in emit diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt index 0c55b63b07..6d21559554 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource6.errors.txt @@ -1,4 +1,3 @@ -parserRealSource6.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource6.ts(8,24): error TS2304: Cannot find name 'Script'. parserRealSource6.ts(10,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource6.ts(10,69): error TS2304: Cannot find name 'TypeChecker'. @@ -60,13 +59,11 @@ parserRealSource6.ts(212,81): error TS2304: Cannot find name 'ISourceText'. parserRealSource6.ts(215,20): error TS2339: Property 'getAstWalkerFactory' does not exist on type 'typeof TypeScript'. -==== parserRealSource6.ts (60 errors) ==== +==== parserRealSource6.ts (59 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class TypeCollectionContext { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt index e91833fac9..9103a77c23 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource7.errors.txt @@ -1,4 +1,3 @@ -parserRealSource7.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource7.ts(12,38): error TS2304: Cannot find name 'ASTList'. parserRealSource7.ts(12,62): error TS2304: Cannot find name 'TypeLink'. parserRealSource7.ts(16,37): error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? @@ -304,13 +303,11 @@ parserRealSource7.ts(827,34): error TS2304: Cannot find name 'NodeType'. parserRealSource7.ts(828,13): error TS2304: Cannot find name 'popTypeCollectionScope'. -==== parserRealSource7.ts (304 errors) ==== +==== parserRealSource7.ts (303 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Continuation { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt index 56c4a714dc..359492c310 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource8.errors.txt @@ -1,4 +1,3 @@ -parserRealSource8.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource8.ts(9,41): error TS2304: Cannot find name 'ScopeChain'. parserRealSource8.ts(10,39): error TS2304: Cannot find name 'TypeFlow'. parserRealSource8.ts(11,43): error TS2304: Cannot find name 'ModuleDeclaration'. @@ -130,13 +129,11 @@ parserRealSource8.ts(453,38): error TS2304: Cannot find name 'NodeType'. parserRealSource8.ts(454,35): error TS2552: Cannot find name 'Catch'. Did you mean 'Cache'? -==== parserRealSource8.ts (130 errors) ==== +==== parserRealSource8.ts (129 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { diff --git a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt index 9fd2058cb8..dffb11e04a 100644 --- a/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserRealSource9.errors.txt @@ -1,4 +1,3 @@ -parserRealSource9.ts(4,21): error TS6053: File 'typescript.ts' not found. parserRealSource9.ts(8,38): error TS2304: Cannot find name 'TypeChecker'. parserRealSource9.ts(9,48): error TS2304: Cannot find name 'TypeLink'. parserRealSource9.ts(9,67): error TS2304: Cannot find name 'SymbolScope'. @@ -39,13 +38,11 @@ parserRealSource9.ts(200,28): error TS2304: Cannot find name 'SymbolScope'. parserRealSource9.ts(200,48): error TS2304: Cannot find name 'IHashTable'. -==== parserRealSource9.ts (39 errors) ==== +==== parserRealSource9.ts (38 errors) ==== // Copyright (c) Microsoft. All rights reserved. Licensed under the Apache License, Version 2.0. // See LICENSE.txt in the project root for complete license information. /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'typescript.ts' not found. module TypeScript { export class Binder { diff --git a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt index 478eb1cffe..31a75354a8 100644 --- a/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserharness.errors.txt @@ -1,4 +1,3 @@ -parserharness.ts(19,21): error TS6053: File 'diff.ts' not found. parserharness.ts(21,21): error TS2749: 'Harness.Assert' refers to a value, but is being used as a type here. Did you mean 'typeof Harness.Assert'? parserharness.ts(25,17): error TS2304: Cannot find name 'IIO'. parserharness.ts(41,12): error TS2304: Cannot find name 'ActiveXObject'. @@ -107,7 +106,7 @@ parserharness.ts(1787,68): error TS2503: Cannot find namespace 'Services'. parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean 'diff'? -==== parserharness.ts (107 errors) ==== +==== parserharness.ts (106 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -127,8 +126,6 @@ parserharness.ts(2030,32): error TS2552: Cannot find name 'Diff'. Did you mean ' /// /// /// - ~~~~~~~ -!!! error TS6053: File 'diff.ts' not found. declare var assert: Harness.Assert; ~~~~~~~~~~~~~~ diff --git a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt index ecef6e2a1d..c3eb8c504f 100644 --- a/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/parserindenter.errors.txt @@ -1,4 +1,3 @@ -parserindenter.ts(16,21): error TS6053: File 'formatting.ts' not found. parserindenter.ts(20,38): error TS2304: Cannot find name 'ILineIndenationResolver'. parserindenter.ts(22,33): error TS2304: Cannot find name 'IndentationBag'. parserindenter.ts(24,42): error TS2304: Cannot find name 'Dictionary_int_int'. @@ -128,7 +127,7 @@ parserindenter.ts(735,42): error TS2304: Cannot find name 'TokenSpan'. parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. -==== parserindenter.ts (128 errors) ==== +==== parserindenter.ts (127 errors) ==== // // Copyright (c) Microsoft Corporation. All rights reserved. // @@ -145,8 +144,6 @@ parserindenter.ts(736,38): error TS2304: Cannot find name 'TypeScript'. // /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'formatting.ts' not found. module Formatting { diff --git a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt index 833098432b..ca1c2ae9a6 100644 --- a/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt +++ b/testdata/baselines/reference/submodule/conformance/scannertest1.errors.txt @@ -1,4 +1,3 @@ -scannertest1.ts(1,21): error TS6053: File 'References.ts' not found. scannertest1.ts(5,21): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(5,47): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(9,16): error TS2662: Cannot find name 'isDecimalDigit'. Did you mean the static member 'CharacterInfo.isDecimalDigit'? @@ -16,10 +15,8 @@ scannertest1.ts(19,23): error TS2304: Cannot find name 'CharacterCodes'. scannertest1.ts(20,23): error TS2304: Cannot find name 'CharacterCodes'. -==== scannertest1.ts (16 errors) ==== +==== scannertest1.ts (15 errors) ==== /// - ~~~~~~~~~~~~~ -!!! error TS6053: File 'References.ts' not found. class CharacterInfo { public static isDecimalDigit(c: number): boolean { From aa2b4cfdc1d8c71a3b6bf253b02677dbb44d906c Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 22:37:07 +0000 Subject: [PATCH 20/22] fix --- internal/compiler/fileloader.go | 4 ++-- internal/compiler/program.go | 21 ++++++++++++++++++++- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index 62e696315a..f29e8eef46 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -52,7 +52,7 @@ type fileLoader struct { } type missingFile struct { - path string + path tspath.Path reason *FileIncludeReason } @@ -177,7 +177,7 @@ func processAllProgramFiles( // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { missingFiles = append(missingFiles, missingFile{ - path: task.normalizedFilePath, + path: task.path, reason: task.includeReason, }) return diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 31fcdbdf88..c29bbe2096 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1247,6 +1247,25 @@ func (p *Program) addProgramDiagnostics() { p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } + + // ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { + // // refPath := tspath.Join(parent., r.FileName) // make it absolute + // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) + // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) + // }) + + // if ref == nil { + // continue + // } + + // diagnostic := ast.NewDiagnostic( + // parent, + // ref.TextRange, + // diagnostics.File_0_not_found, + // m.path, + // ) + + // p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } @@ -1582,7 +1601,7 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { return slices.ContainsFunc(p.missingFiles, func(missingPath missingFile) bool { - return missingPath.path == string(path) + return missingPath.path == path }) } From 363bde5c08d75a3c1198174796171de3dbd7cca9 Mon Sep 17 00:00:00 2001 From: han Date: Thu, 20 Nov 2025 23:36:13 +0000 Subject: [PATCH 21/22] keep fixing --- internal/compiler/fileloader.go | 4 ++-- internal/compiler/program.go | 23 ++--------------------- 2 files changed, 4 insertions(+), 23 deletions(-) diff --git a/internal/compiler/fileloader.go b/internal/compiler/fileloader.go index f29e8eef46..62e696315a 100644 --- a/internal/compiler/fileloader.go +++ b/internal/compiler/fileloader.go @@ -52,7 +52,7 @@ type fileLoader struct { } type missingFile struct { - path tspath.Path + path string reason *FileIncludeReason } @@ -177,7 +177,7 @@ func processAllProgramFiles( // !!! sheetal file preprocessing diagnostic explaining getSourceFileFromReferenceWorker if file == nil { missingFiles = append(missingFiles, missingFile{ - path: task.path, + path: task.normalizedFilePath, reason: task.includeReason, }) return diff --git a/internal/compiler/program.go b/internal/compiler/program.go index c29bbe2096..1ec58367fa 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -1237,7 +1237,7 @@ func (p *Program) addProgramDiagnostics() { } for _, ref := range parentFile.ReferencedFiles { - if tspath.GetNormalizedAbsolutePath(ref.FileName, tspath.GetDirectoryPath(parentFile.FileName())) == missingFile.path { + if tspath.GetNormalizedAbsolutePath(tspath.GetDirectoryPath(parentFile.FileName()), ref.FileName) == missingFile.path { diagnostic := ast.NewDiagnostic( parentFile, ref.TextRange, @@ -1247,25 +1247,6 @@ func (p *Program) addProgramDiagnostics() { p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } - - // ref := core.Find(parent.ReferencedFiles, func(r *ast.FileReference) bool { - // // refPath := tspath.Join(parent., r.FileName) // make it absolute - // // return tspath.NormalizePath(refPath) == tspath.NormalizePath(m.path) - // return tspath.GetBaseFileName(tspath.NormalizePath(r.FileName)) == tspath.GetBaseFileName(m.path) - // }) - - // if ref == nil { - // continue - // } - - // diagnostic := ast.NewDiagnostic( - // parent, - // ref.TextRange, - // diagnostics.File_0_not_found, - // m.path, - // ) - - // p.programDiagnostics = append(p.programDiagnostics, diagnostic) } } @@ -1601,7 +1582,7 @@ func (p *Program) GetIncludeReasons() map[tspath.Path][]*FileIncludeReason { // Testing only func (p *Program) IsMissingPath(path tspath.Path) bool { return slices.ContainsFunc(p.missingFiles, func(missingPath missingFile) bool { - return missingPath.path == path + return missingPath.path == string(path) }) } From 7e18c1f83672e6688ac3980d2ed83aacab79e090 Mon Sep 17 00:00:00 2001 From: han Date: Fri, 21 Nov 2025 11:29:21 +0000 Subject: [PATCH 22/22] raise error but change other behaviours --- internal/compiler/program.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/compiler/program.go b/internal/compiler/program.go index 1ec58367fa..c512ca4b09 100644 --- a/internal/compiler/program.go +++ b/internal/compiler/program.go @@ -59,6 +59,7 @@ type Program struct { declarationDiagnosticCache collections.SyncMap[*ast.SourceFile, []*ast.Diagnostic] programDiagnostics []*ast.Diagnostic + programDiagnosticsOnce sync.Once hasEmitBlockingDiagnostics collections.Set[tspath.Path] sourceFilesToEmitOnce sync.Once @@ -210,8 +211,8 @@ func NewProgram(opts ProgramOptions) *Program { p := &Program{opts: opts} p.initCheckerPool() p.processedFiles = processAllProgramFiles(p.opts, p.SingleThreaded()) - p.addProgramDiagnostics() p.verifyCompilerOptions() + p.addProgramDiagnostics() return p } @@ -1237,12 +1238,12 @@ func (p *Program) addProgramDiagnostics() { } for _, ref := range parentFile.ReferencedFiles { - if tspath.GetNormalizedAbsolutePath(tspath.GetDirectoryPath(parentFile.FileName()), ref.FileName) == missingFile.path { + if tspath.GetNormalizedAbsolutePath(ref.FileName, tspath.GetDirectoryPath(parentFile.FileName())) == missingFile.path { diagnostic := ast.NewDiagnostic( parentFile, ref.TextRange, diagnostics.File_0_not_found, - missingFile.path, + ref.FileName, ) p.programDiagnostics = append(p.programDiagnostics, diagnostic) }