File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -34,12 +34,12 @@ namespace ts.GoToDefinition {
34
34
// For a function, if this is the original function definition, return just sigInfo.
35
35
// If this is the original constructor definition, parent is the class.
36
36
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 ) ) ) {
39
39
return [ sigInfo ] ;
40
40
}
41
41
else {
42
- const defs = getDefinitionFromSymbol ( typeChecker , symbol , node ) ! ;
42
+ const defs = getDefinitionFromSymbol ( typeChecker , symbol , node ) || emptyArray ;
43
43
// For a 'super()' call, put the signature first, else put the variable first.
44
44
return node . kind === SyntaxKind . SuperKeyword ? [ sigInfo , ...defs ] : [ ...defs , sigInfo ] ;
45
45
}
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