-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScript
Description
TypeScript Version: 3.2.1
Search Terms:
Code
declare global {
const React: typeof import("react");
const ReactDOM: typeof import("react-dom");
}
export {};Expected behavior:
Actual behavior:
> tsc
/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:71026
throw e;
^
Error: Debug Failure. Invalid cast. The supplied value [object Object] did not pass the test 'isJsonSourceFile'.
at Object.cast (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:1158:22)
at getTypeOfVariableOrParameterOrPropertyWorker (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:29354:41)
at getTypeOfVariableOrParameterOrProperty (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:29334:48)
at getTypeOfSymbol (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:29603:24)
at resolveImportSymbolType (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:33159:45)
at getTypeFromImportTypeNode (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:33141:25)
at getTypeFromTypeNode (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:33460:28)
at checkImportType (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:43996:13)
at checkSourceElement (/Users/akari/Developer/test/node_modules/typescript/lib/tsc.js:46921:28)
Playground Link:
https://gist.github.com/magic-akari/aa10dfb809268eb4f63d5749d113a93a
Related Issues:
jcdelmas, bali182, luvies, Can-Sahin, andybarron and 16 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScript