Skip to content

Commit 8894915

Browse files
author
Andy Hanson
committed
buildSymbolDisplay: Handle alias parentSymbol
1 parent 5e20c1c commit 8894915

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
@@ -2027,7 +2027,7 @@ namespace ts {
20272027
ts.forEach(symbolFromSymbolTable.declarations, isExternalModuleImportEqualsDeclaration)) {
20282028

20292029
const resolvedImportedSymbol = resolveAlias(symbolFromSymbolTable);
2030-
if (isAccessible(symbolFromSymbolTable, resolveAlias(symbolFromSymbolTable))) {
2030+
if (isAccessible(symbolFromSymbolTable, resolvedImportedSymbol)) {
20312031
return [symbolFromSymbolTable];
20322032
}
20332033

@@ -3087,8 +3087,8 @@ namespace ts {
30873087
// Write type arguments of instantiated class/interface here
30883088
if (flags & SymbolFormatFlags.WriteTypeParametersOrArguments) {
30893089
if (getCheckFlags(symbol) & CheckFlags.Instantiated) {
3090-
buildDisplayForTypeArgumentsAndDelimiters(getTypeParametersOfClassOrInterface(parentSymbol),
3091-
(<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
3090+
const params = getTypeParametersOfClassOrInterface(symbol.flags & SymbolFlags.Alias ? resolveAlias(symbol) : symbol);
3091+
buildDisplayForTypeArgumentsAndDelimiters(params, (<TransientSymbol>symbol).mapper, writer, enclosingDeclaration);
30923092
}
30933093
else {
30943094
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)