Skip to content

Incorrect export causes assertion failure in declaration emitter #4506

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

Closed
weswigham opened this issue Aug 27, 2015 · 0 comments
Closed

Incorrect export causes assertion failure in declaration emitter #4506

weswigham opened this issue Aug 27, 2015 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@weswigham
Copy link
Member

if (false) {
  export var myClass = 0;
}
export type MyClass = typeof myClass;

Trying to compile this with "declaration" on causes tsc to fatally error out with a Debug Failure (I've noticed the language service hangs on this file, yet to investigate why but I assume it's the same reason), after reporting the (correct) error

 error TS1184: Modifiers cannot appear here.

Specifically, we get

Error: Debug Failure. False expression: isDeclarationVisible unknown: SyntaxKind: 190

SyntaxKind 190 refers to the Block kind. Looking at isDeclarationVisible, this is likely because it has an export flag, so it tries to check its parent's visibility (the block) and errors since it doesn't have a branch to handle Block.

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Aug 27, 2015
@mhegazy mhegazy self-assigned this Aug 28, 2015
@mhegazy mhegazy added this to the TypeScript 1.7 milestone Aug 28, 2015
@mhegazy mhegazy modified the milestones: TypeScript 1.7, TypeScript 1.8 Oct 9, 2015
@mhegazy mhegazy modified the milestones: TypeScript 1.8, TypeScript 2.0 Dec 8, 2015
@mhegazy mhegazy closed this as completed in 15f07e6 Mar 4, 2016
@mhegazy mhegazy added the Fixed A PR has been merged for this issue label Mar 4, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants