You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/** * @enum {string} <-- Commenting this out sucessfully compiles */varDICTIONARY: {[key: string]: string}={'&': '&'};// Or commenting out this function causes the compilation to succeed.functionlookup(s: string): string{returnDICTIONARY[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)
@Andy-MS I am still seeing this error in 3.1.0-dev.20180915
Debug Failure. Declaration to checkResolvedBlockScopedVariable is undefined
at checkResolvedBlockScopedVariable (node_modules/typescript/lib/typescript.js:31697:33)
at resolveNameHelper (node_modules/typescript/lib/typescript.js:31538:25)
at resolveName (node_modules/typescript/lib/typescript.js:31219:20)
at getResolvedSymbol (node_modules/typescript/lib/typescript.js:43026:21)
at checkIdentifier (node_modules/typescript/lib/typescript.js:44474:26)
at checkExpressionWorker (node_modules/typescript/lib/typescript.js:50599:28)
at checkExpression (node_modules/typescript/lib/typescript.js:50571:42)
at checkNonNullExpression (node_modules/typescript/lib/typescript.js:47062:37)
at checkPropertyAccessExpressionOrQualifiedName (node_modules/typescript/lib/typescript.js:47088:28)
at checkPropertyAccessExpression (node_modules/typescript/lib/typescript.js:47081:20)
I tried all TypeScript versions with a script and found that the error was introduced in 3.1.0-dev.20180906. The last working version was 3.1.0-dev.20180905. Unfortunately, I am depending on a different bug fix from a later version so I cannot downgrade.
TypeScript Version: 3.1.0-dev.20180912
Search Terms:
Code
Expected behavior:
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:
https://www.typescriptlang.org/play/index.html#src=%2F**%0D%0A%20*%20%40enum%20%7Bstring%7D%20%3C--%20Commenting%20this%20out%20sucessfully%20compiles%0D%0A%20*%2F%0D%0Avar%20DICTIONARY%3A%20%7B%20%5Bkey%3A%20string%5D%3A%20string%20%7D%20%3D%20%7B%0D%0A%20%20%20%20'%26'%3A%20'%26amp%3B'%0D%0A%7D%3B%0D%0A%0D%0A%2F%2F%20Or%20commenting%20out%20this%20function%20causes%20the%20compilation%20to%20succeed.%0D%0Afunction%20lookup(s%3A%20string)%3A%20string%20%7B%0D%0A%20%20%20%20return%20DICTIONARY%5Bs%5D%20%7C%7C%20%22%22%3B%0D%0A%7D
Related Issues:
The text was updated successfully, but these errors were encountered: