Skip to content

TypeError: Cannot read property 'flags' of undefined at isRelatedTo #27345

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
minestarks opened this issue Sep 25, 2018 · 3 comments
Closed

TypeError: Cannot read property 'flags' of undefined at isRelatedTo #27345

minestarks opened this issue Sep 25, 2018 · 3 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

@minestarks
Copy link
Member

TypeScript Version: 3.1.0-dev.20180925

git clone --depth=1 https://github.com/0xfe/vexflow
cd vexflow
tsc --init
tsc --allowJs --checkJs

Compiler crashes with the callstack:

TypeError: Cannot read property 'flags' of undefined
    at isRelatedTo (node_modules\typescript\lib\tsc.js:33794:28)
    at compareSignaturesRelated (node_modules\typescript\lib\tsc.js:33533:25)
    at signatureRelatedTo (node_modules\typescript\lib\tsc.js:34639:24)
    at signaturesRelatedTo (node_modules\typescript\lib\tsc.js:34614:30)
    at structuredTypeRelatedTo (node_modules\typescript\lib\tsc.js:34403:43)
    at recursiveTypeRelatedTo (node_modules\typescript\lib\tsc.js:34190:53)
    at isRelatedTo (node_modules\typescript\lib\tsc.js:33875:38)
    at checkTypeRelatedTo (node_modules\typescript\lib\tsc.js:33709:26)
    at isTypeRelatedTo (node_modules\typescript\lib\tsc.js:33691:24)
    at isTypeSubtypeOf (node_modules\typescript\lib\tsc.js:33172:20)
@RyanCavanaugh
Copy link
Member

Confirmed call stack on master; regression from 3.0

@RyanCavanaugh
Copy link
Member

Minimal repro:

export class Alpha { }
export class Beta {
  /**
   * @constructor
   */
  constructor() {
  }
}

const arr = [Alpha, Beta];

Note that the JS Doc comment matters

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Sep 25, 2018
@RyanCavanaugh RyanCavanaugh added this to the TypeScript 3.2 milestone Sep 25, 2018
@sandersn
Copy link
Member

@constructor put on anything incorrectly makes it a JS constructor. This is a problem for actual constructors, because getJSClassType doesn't work on actual classes.

@sandersn sandersn added the Fixed A PR has been merged for this issue label Sep 26, 2018
@weswigham weswigham added the Crash For flagging bugs which are compiler or service crashes or unclean exits, rather than bad output label Sep 27, 2018
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

5 participants