Skip to content

Commit 8b15e2b

Browse files
author
Andy
authored
Merge pull request #16026 from Microsoft/importEqualsMethod
buildSymbolDisplay: Handle alias parentSymbol
2 parents f8aae89 + bf7e322 commit 8b15e2b

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

src/compiler/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,7 +2033,7 @@ namespace ts {
20332033
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
20342034

20352035
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
2036-
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
2036+
if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) {
20372037
return [symbolFromSymbolTable];
20382038
}
20392039

@@ -3093,8 +3093,8 @@ namespace ts {
30933093
// Write type arguments of instantiated class/interface here
30943094
if (flags & SymbolFormatFlags.WriteTypeParametersOrArguments) {
30953095
if (getCheckFlags(symbol) & CheckFlags.Instantiated) {
3096-
buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol),
3097-
(<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
3096+
const params = getTypeParametersOfClassOrInterface(parentSymbol.flags & SymbolFlags.Alias ? resolveAlias(parentSymbol) : parentSymbol);
3097+
buildDisplayForTypeArgumentsAndDelimiters(params, (<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
30983098
}
30993099
else {
31003100
buildTypeParameterDisplayFromSymbol(parentSymbol, writer, enclosingDeclaration);
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/// <reference path="fourslash.ts" />
2+
3+
// Test for https://github.com/Microsoft/TypeScript/issues/15931
4+
5+
// @Filename: /a.d.ts
6+
////declare class C<T> {
7+
//// m(): void;
8+
////}
9+
////export = C;
10+
11+
// @Filename: /b.ts
12+
////import C = require("./a");
13+
////declare var x: C<number>;
14+
////x./**/m;
15+
16+
verify.quickInfoAt("", "(method) C<number>.m(): void", undefined);

0 commit comments

Comments
 (0)