Skip to content
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

Language service crash in 'displayPartKind' #12166

Closed
DanielRosenwasser opened this issue Nov 11, 2016 · 3 comments
Closed

Language service crash in 'displayPartKind' #12166

DanielRosenwasser opened this issue Nov 11, 2016 · 3 comments
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@DanielRosenwasser
Copy link
Member

In Version 2.1.0-dev.20161110

TypeError: Cannot read property 'flags' of undefined
    at displayPartKind (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:51437:31)
    at symbolPart (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:51435:34)
    at Object.writeSymbol (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:51422:31)
    at buildBindingElementDisplay (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22476:28)
    at C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22457:110
    at buildDisplayForCommaSeparatedList (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22503:21)
    at buildBindingPatternDisplay (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22457:21)
    at buildParameterDisplay (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22442:21)
    at buildDisplayForParametersAndDelimiters (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22531:21)
    at buildSignatureDisplay (C:\Users\drosen\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js:22575:17)
@DanielRosenwasser DanielRosenwasser added the Bug A bug in TypeScript label Nov 11, 2016
@DanielRosenwasser DanielRosenwasser changed the title Language service crash Language service crash in 'displayPartKind' Nov 11, 2016
@ahejlsberg
Copy link
Member

@DanielRosenwasser Repro?

@DanielRosenwasser
Copy link
Member Author

@mhegazy told me to just file this and we'll discuss offline.

@nickytonline
Copy link

nickytonline commented Nov 30, 2016

I'm able to produce this error by destructuring arguments two levels deep, e.g.

import * as React from 'react';

interface SomeInterface {
	someBoolean: boolean,
	someString: string;
}

interface SomeProps {
  someProp: SomeInterface;
}

export const SomeStatelessComponent = ({someProp: { someBoolean, someString}}: SomeProps) => (<div>{`${someBoolean}${someString}`}</div>);

but if I destruct just the top level, e.g. someProp, it works

export const SomeStatelessComponent = ({someProp}: SomeProps) => (<div>{`${someProp.someBoolean}${someProp.someString}`}</div>);

@mhegazy mhegazy added this to the TypeScript 2.2 milestone Dec 1, 2016
sheetalkamat added a commit that referenced this issue Dec 6, 2016
There wont be any symbol for the property name but we already know it is a property name
Fixes #12166
@sheetalkamat sheetalkamat added the Fixed A PR has been merged for this issue label Dec 6, 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

5 participants