Skip to content

Language service crash in 'displayPartKind' #12166

Description

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)

Activity

  1. changed the title [-]Language service crash[/-] [+]Language service crash in 'displayPartKind'[/+] on Nov 11, 2016
  2. ahejlsberg commented on Nov 11, 2016

    @ahejlsberg
    Member
  3. DanielRosenwasser commented on Nov 11, 2016

    @DanielRosenwasser
    MemberAuthor

    Mohamed Hegazy (@mhegazy) told me to just file this and we'll discuss offline.

  4. nickytonline commented on Nov 30, 2016

    @nickytonline

    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>);
    
  5. added a commit that references this issue on Dec 6, 2016
    7d049c2
  6. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions