-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed
Closed
Copy link
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Description
TypeScript Version: 3.1.0-dev.20180912
Search Terms:
- checkResolvedBlockScopedVariable
Code
/**
* @enum {string} <-- Commenting this out sucessfully compiles
*/
var DICTIONARY: { [key: string]: string } = {
'&': '&'
};
// Or commenting out this function causes the compilation to succeed.
function lookup(s: string): string {
return DICTIONARY[s] || "";
}
Expected behavior:
- Should compile without error.
Actual behavior:
If the @enum {string}
comment is removed or if the function is commented out, the compiler will be successful. Otherwise, if the function is present and the @enum {string}
is present it will not.
/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:69144
throw e;
^
Error: Debug Failure. Declaration to checkResolvedBlockScopedVariable is undefined
at checkResolvedBlockScopedVariable (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:25869:33)
at resolveNameHelper (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:25720:25)
at resolveName (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:25487:20)
at getResolvedSymbol (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:35871:21)
at checkIdentifier (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:37132:26)
at checkExpressionWorker (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:42140:28)
at checkExpression (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:42116:42)
at checkNonNullExpression (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:39149:37)
at checkIndexedAccess (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:39465:30)
at checkExpressionWorker (/Users/athasach/dev/research/ts3.1_bug/node_modules/typescript/lib/tsc.js:42168:28)
Playground Link:
Related Issues:
felixfbecker
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue