File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ namespace ts.GoToDefinition {
3434 // For a function, if this is the original function definition, return just sigInfo.
3535 // If this is the original constructor definition, parent is the class.
3636 if ( typeChecker . getRootSymbols ( symbol ) . some ( s => symbolMatchesSignature ( s , calledDeclaration ) ) ||
37- // TODO: GH#23742 Following check shouldn't be necessary if 'require' is an alias
38- symbol . declarations . some ( d => isVariableDeclaration ( d ) && ! ! d . initializer && isRequireCall ( d . initializer , /*checkArgumentIsStringLiteralLike*/ false ) ) ) {
37+ // TODO: GH#25533 Following check shouldn't be necessary if 'require' is an alias
38+ symbol . declarations && symbol . declarations . some ( d => isVariableDeclaration ( d ) && ! ! d . initializer && isRequireCall ( d . initializer , /*checkArgumentIsStringLiteralLike*/ false ) ) ) {
3939 return [ sigInfo ] ;
4040 }
4141 else {
42- const defs = getDefinitionFromSymbol ( typeChecker , symbol , node ) ! ;
42+ const defs = getDefinitionFromSymbol ( typeChecker , symbol , node ) || emptyArray ;
4343 // For a 'super()' call, put the signature first, else put the variable first.
4444 return node . kind === SyntaxKind . SuperKeyword ? [ sigInfo , ...defs ] : [ ...defs , sigInfo ] ;
4545 }
Original file line number Diff line number Diff line change 1+ ///<reference path="fourslash.ts"/>
2+
3+ ////interface I { /*def*/m(): void; };
4+ ////declare const i: { [K in "m"]: I[K] };
5+ ////i.[|/*ref*/m|]();
6+
7+ verify . goToDefinition ( "ref" , "def" ) ;
You can’t perform that action at this time.
0 commit comments