-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Compiler (still) crashes with "Declaration to checkResolvedBlockScopedVariable is undefined" #27134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@Kingwl I am not saying that code triggers it. I don't know what triggers this, it's a codebase with thousands of lines of code, it could be anything. But the stack trace is real |
🤷🏻♂️ |
@RyanCavanaugh I have a quite a few repros of this Version 3.1.0-dev.20180925
|
Validated 3.1 call stack. Regression from 3.0. |
Simplest repro /**
* @enum {number}
*/
var foo = { };
/**
* @type {foo}
*/
var s; The problem here is that Failure here: function checkResolvedBlockScopedVariable(result: Symbol, errorLocation: Node): void {
Debug.assert(!!(result.flags & SymbolFlags.BlockScopedVariable || result.flags & SymbolFlags.Class || result.flags & SymbolFlags.Enum));
// Block-scoped variables cannot be used before their definition
const declaration = forEach(result.declarations, d => isBlockOrCatchScoped(d) || isClassLike(d) || (d.kind === SyntaxKind.EnumDeclaration) ? d : undefined);
if (declaration === undefined) return Debug.fail("Declaration to checkResolvedBlockScopedVariable is undefined"); |
Similar/same as #27061, but still happening in
3.1.0-dev.20180915
.Introduced in
3.1.0-dev.20180906
, last working version was3.1.0-dev.20180905
.Stack trace:
TypeScript Version: 3.1.0-dev.20180915
The text was updated successfully, but these errors were encountered: