Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the crash when affected file pending emit is not in program is be…
- Loading branch information
1 parent
9f93c67
commit af36a85
Showing
3 changed files
with
236 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
213 changes: 213 additions & 0 deletions
213
...aselines/reference/tsc/incremental/file-deleted-before-fixing-error-with-noEmitOnError.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,213 @@ | ||
Input:: | ||
//// [/lib/lib.d.ts] | ||
/// <reference no-default-lib="true"/> | ||
interface Boolean {} | ||
interface Function {} | ||
interface CallableFunction {} | ||
interface NewableFunction {} | ||
interface IArguments {} | ||
interface Number { toExponential: any; } | ||
interface Object {} | ||
interface RegExp {} | ||
interface String { charAt: any; } | ||
interface Array<T> { length: number; [n: number]: T; } | ||
interface ReadonlyArray<T> {} | ||
declare const console: { log(msg: any): void; }; | ||
|
||
//// [/src/project/file1.ts] | ||
export const x: 30 = "hello"; | ||
|
||
//// [/src/project/file2.ts] | ||
export class D { } | ||
|
||
//// [/src/project/tsconfig.json] | ||
{"compilerOptions":{"outDir":"outDir","noEmitOnError":true}} | ||
|
||
|
||
|
||
Output:: | ||
/lib/tsc --p /src/project -i | ||
[96msrc/project/file1.ts[0m:[93m1[0m:[93m14[0m - [91merror[0m[90m TS2322: [0mType '"hello"' is not assignable to type '30'. | ||
|
||
[7m1[0m export const x: 30 = "hello"; | ||
[7m [0m [91m ~[0m | ||
|
||
|
||
Found 1 error in src/project/file1.ts[90m:1[0m | ||
|
||
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped | ||
Program root files: ["/src/project/file1.ts","/src/project/file2.ts"] | ||
Program options: {"outDir":"/src/project/outDir","noEmitOnError":true,"project":"/src/project","incremental":true,"configFilePath":"/src/project/tsconfig.json"} | ||
Program structureReused: Not | ||
Program files:: | ||
/lib/lib.d.ts | ||
/src/project/file1.ts | ||
/src/project/file2.ts | ||
|
||
Semantic diagnostics in builder refreshed for:: | ||
/lib/lib.d.ts | ||
/src/project/file1.ts | ||
/src/project/file2.ts | ||
|
||
Shape signatures in builder refreshed for:: | ||
/lib/lib.d.ts (used version) | ||
/src/project/file1.ts (used version) | ||
/src/project/file2.ts (used version) | ||
|
||
|
||
//// [/src/project/outDir/tsconfig.tsbuildinfo] | ||
{"program":{"fileNames":["../../../lib/lib.d.ts","../file1.ts","../file2.ts"],"fileInfos":[{"version":"3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10927263693-export const x: 30 = \"hello\";","-7804761415-export class D { }"],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"../file1.ts","start":13,"length":1,"code":2322,"category":1,"messageText":"Type '\"hello\"' is not assignable to type '30'."}]],3],"affectedFilesPendingEmit":[2,3]},"version":"FakeTSVersion"} | ||
|
||
//// [/src/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] | ||
{ | ||
"program": { | ||
"fileNames": [ | ||
"../../../lib/lib.d.ts", | ||
"../file1.ts", | ||
"../file2.ts" | ||
], | ||
"fileInfos": { | ||
"../../../lib/lib.d.ts": { | ||
"original": { | ||
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"affectsGlobalScope": true | ||
}, | ||
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"affectsGlobalScope": true | ||
}, | ||
"../file1.ts": { | ||
"version": "-10927263693-export const x: 30 = \"hello\";", | ||
"signature": "-10927263693-export const x: 30 = \"hello\";" | ||
}, | ||
"../file2.ts": { | ||
"version": "-7804761415-export class D { }", | ||
"signature": "-7804761415-export class D { }" | ||
} | ||
}, | ||
"options": { | ||
"noEmitOnError": true, | ||
"outDir": "./" | ||
}, | ||
"referencedMap": {}, | ||
"exportedModulesMap": {}, | ||
"semanticDiagnosticsPerFile": [ | ||
"../../../lib/lib.d.ts", | ||
[ | ||
"../file1.ts", | ||
[ | ||
{ | ||
"file": "../file1.ts", | ||
"start": 13, | ||
"length": 1, | ||
"code": 2322, | ||
"category": 1, | ||
"messageText": "Type '\"hello\"' is not assignable to type '30'." | ||
} | ||
] | ||
], | ||
"../file2.ts" | ||
], | ||
"affectedFilesPendingEmit": [ | ||
[ | ||
"../file1.ts", | ||
"Js" | ||
], | ||
[ | ||
"../file2.ts", | ||
"Js" | ||
] | ||
] | ||
}, | ||
"version": "FakeTSVersion", | ||
"size": 977 | ||
} | ||
|
||
|
||
|
||
Change:: delete file without error | ||
Input:: | ||
//// [/src/project/file2.ts] unlink | ||
|
||
|
||
Output:: | ||
/lib/tsc --p /src/project -i | ||
[96msrc/project/file1.ts[0m:[93m1[0m:[93m14[0m - [91merror[0m[90m TS2322: [0mType '"hello"' is not assignable to type '30'. | ||
|
||
[7m1[0m export const x: 30 = "hello"; | ||
[7m [0m [91m ~[0m | ||
|
||
|
||
Found 1 error in src/project/file1.ts[90m:1[0m | ||
|
||
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped | ||
Program root files: ["/src/project/file1.ts"] | ||
Program options: {"outDir":"/src/project/outDir","noEmitOnError":true,"project":"/src/project","incremental":true,"configFilePath":"/src/project/tsconfig.json"} | ||
Program structureReused: Not | ||
Program files:: | ||
/lib/lib.d.ts | ||
/src/project/file1.ts | ||
|
||
Semantic diagnostics in builder refreshed for:: | ||
|
||
No shapes updated in the builder:: | ||
|
||
|
||
//// [/src/project/outDir/tsconfig.tsbuildinfo] | ||
{"program":{"fileNames":["../../../lib/lib.d.ts","../file1.ts"],"fileInfos":[{"version":"3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };","affectsGlobalScope":true},"-10927263693-export const x: 30 = \"hello\";"],"options":{"noEmitOnError":true,"outDir":"./"},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[1,[2,[{"file":"../file1.ts","start":13,"length":1,"code":2322,"category":1,"messageText":"Type '\"hello\"' is not assignable to type '30'."}]]],"affectedFilesPendingEmit":[2]},"version":"FakeTSVersion"} | ||
|
||
//// [/src/project/outDir/tsconfig.tsbuildinfo.readable.baseline.txt] | ||
{ | ||
"program": { | ||
"fileNames": [ | ||
"../../../lib/lib.d.ts", | ||
"../file1.ts" | ||
], | ||
"fileInfos": { | ||
"../../../lib/lib.d.ts": { | ||
"original": { | ||
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"affectsGlobalScope": true | ||
}, | ||
"version": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"signature": "3858781397-/// <reference no-default-lib=\"true\"/>\ninterface Boolean {}\ninterface Function {}\ninterface CallableFunction {}\ninterface NewableFunction {}\ninterface IArguments {}\ninterface Number { toExponential: any; }\ninterface Object {}\ninterface RegExp {}\ninterface String { charAt: any; }\ninterface Array<T> { length: number; [n: number]: T; }\ninterface ReadonlyArray<T> {}\ndeclare const console: { log(msg: any): void; };", | ||
"affectsGlobalScope": true | ||
}, | ||
"../file1.ts": { | ||
"version": "-10927263693-export const x: 30 = \"hello\";", | ||
"signature": "-10927263693-export const x: 30 = \"hello\";" | ||
} | ||
}, | ||
"options": { | ||
"noEmitOnError": true, | ||
"outDir": "./" | ||
}, | ||
"referencedMap": {}, | ||
"exportedModulesMap": {}, | ||
"semanticDiagnosticsPerFile": [ | ||
"../../../lib/lib.d.ts", | ||
[ | ||
"../file1.ts", | ||
[ | ||
{ | ||
"file": "../file1.ts", | ||
"start": 13, | ||
"length": 1, | ||
"code": 2322, | ||
"category": 1, | ||
"messageText": "Type '\"hello\"' is not assignable to type '30'." | ||
} | ||
] | ||
] | ||
], | ||
"affectedFilesPendingEmit": [ | ||
[ | ||
"../file1.ts", | ||
"Js" | ||
] | ||
] | ||
}, | ||
"version": "FakeTSVersion", | ||
"size": 926 | ||
} | ||
|