Skip to content

tsc crashes when decorating negative number literal fields #29329

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
yanche opened this issue Jan 9, 2019 · 0 comments
Closed

tsc crashes when decorating negative number literal fields #29329

yanche opened this issue Jan 9, 2019 · 0 comments
Assignees
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue

Comments

@yanche
Copy link

yanche commented Jan 9, 2019

Crash stack looks like this
Error: Debug Failure. Unexpected node.
Node 202 was unexpected.
at serializeTypeNode ($PATH\node_modules\typescript\lib\tsc.js:56506:45)

TypeScript Version: 3.3.0-dev.20190108

Search Terms:
decorat; negative; number literal
Code

class A {
    @decorator
    public field1: -1 = -1;
}
function decorator(target: any, field: any) {}
{
  "compilerOptions": {
    "target": "es5",
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true
  }
}

Expected behavior:
tsc should not crash in any input

Actual behavior:
tsc crashes in above sample typescript

Playground Link: No, just compile the above ts you will repro the crash easily

Related Issues: No

@weswigham weswigham added Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output labels Jan 9, 2019
@weswigham weswigham self-assigned this Jan 9, 2019
@DanielRosenwasser DanielRosenwasser added the Fixed A PR has been merged for this issue label Jan 10, 2019
@DanielRosenwasser DanielRosenwasser added this to the TypeScript 3.3 milestone Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

3 participants