Skip to content

Commit 3321537

Browse files
authored
Use symbolToTypeNode for class & interface references (#24330) (#24334)
* Use merged symbols when calculating qualification, use symbolToTypeNode * Accept baselines
1 parent 38a0370 commit 3321537

File tree

57 files changed

+392
-300
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+392
-300
lines changed

src/compiler/checker.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2672,7 +2672,7 @@ namespace ts {
26722672
// if the symbolFromSymbolTable is not external module (it could be if it was determined as ambient external module and would be in globals table)
26732673
// and if symbolFromSymbolTable or alias resolution matches the symbol,
26742674
// check the symbol can be qualified, it is only then this symbol is accessible
2675-
!some(symbolFromSymbolTable.declarations, hasExternalModuleSymbol) &&
2675+
!some(symbolFromSymbolTable.declarations, hasNonGlobalAugmentationExternalModuleSymbol) &&
26762676
(ignoreQualification || canQualifySymbol(symbolFromSymbolTable, meaning));
26772677
}
26782678

@@ -2704,6 +2704,11 @@ namespace ts {
27042704
return [symbolFromSymbolTable].concat(accessibleSymbolsFromExports);
27052705
}
27062706
}
2707+
if (symbolFromSymbolTable.escapedName === symbol.escapedName && symbolFromSymbolTable.exportSymbol) {
2708+
if (isAccessible(getMergedSymbol(symbolFromSymbolTable.exportSymbol), /*aliasSymbol*/ undefined, ignoreQualification)) {
2709+
return [symbol];
2710+
}
2711+
}
27072712
});
27082713
}
27092714
}
@@ -2712,7 +2717,7 @@ namespace ts {
27122717
let qualify = false;
27132718
forEachSymbolTableInScope(enclosingDeclaration, symbolTable => {
27142719
// If symbol of this name is not available in the symbol table we are ok
2715-
let symbolFromSymbolTable = symbolTable.get(symbol.escapedName);
2720+
let symbolFromSymbolTable = getMergedSymbol(symbolTable.get(symbol.escapedName));
27162721
if (!symbolFromSymbolTable) {
27172722
// Continue to the next symbol table
27182723
return false;
@@ -2792,7 +2797,7 @@ namespace ts {
27922797
return hasAccessibleDeclarations;
27932798
}
27942799
else {
2795-
if (some(symbol.declarations, hasExternalModuleSymbol)) {
2800+
if (some(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
27962801
// Any meaning of a module symbol is always accessible via an `import` type
27972802
return {
27982803
accessibility: SymbolAccessibility.Accessible
@@ -2850,6 +2855,10 @@ namespace ts {
28502855
return isAmbientModule(declaration) || (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(<SourceFile>declaration));
28512856
}
28522857

2858+
function hasNonGlobalAugmentationExternalModuleSymbol(declaration: Node) {
2859+
return isModuleWithStringLiteralName(declaration) || (declaration.kind === SyntaxKind.SourceFile && isExternalOrCommonJsModule(<SourceFile>declaration));
2860+
}
2861+
28532862
function hasVisibleDeclarations(symbol: Symbol, shouldComputeAliasToMakeVisible: boolean): SymbolVisibilityResult {
28542863
let aliasesToMakeVisible: LateVisibilityPaintedStatement[];
28552864
if (forEach(symbol.declarations, declaration => !getIsDeclarationVisible(declaration))) {
@@ -3164,9 +3173,10 @@ namespace ts {
31643173
!isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
31653174
return createTypeReferenceNode(getGeneratedNameForNode((type.symbol.declarations[0] as TypeParameterDeclaration).name, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.ReservedInNestedScopes), /*typeArguments*/ undefined);
31663175
}
3167-
const name = type.symbol ? symbolToName(type.symbol, context, SymbolFlags.Type, /*expectsIdentifier*/ false) : createIdentifier("?");
31683176
// Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter.
3169-
return createTypeReferenceNode(name, /*typeArguments*/ undefined);
3177+
return type.symbol
3178+
? symbolToTypeNode(type.symbol, context, SymbolFlags.Type)
3179+
: createTypeReferenceNode(createIdentifier("?"), /*typeArguments*/ undefined);
31703180
}
31713181
if (!inTypeAlias && type.aliasSymbol && (context.flags & NodeBuilderFlags.UseAliasDefinedOutsideCurrentScope || isTypeSymbolAccessible(type.aliasSymbol, context.enclosingDeclaration))) {
31723182
const typeArgumentNodes = mapToTypeNodes(type.aliasTypeArguments, context);
@@ -3712,7 +3722,7 @@ namespace ts {
37123722
// If this is the last part of outputting the symbol, always output. The cases apply only to parent symbols.
37133723
endOfChain ||
37143724
// If a parent symbol is an external module, don't write it. (We prefer just `x` vs `"foo/bar".x`.)
3715-
(yieldModuleSymbol || !(!parentSymbol && forEach(symbol.declarations, hasExternalModuleSymbol))) &&
3725+
(yieldModuleSymbol || !(!parentSymbol && forEach(symbol.declarations, hasNonGlobalAugmentationExternalModuleSymbol))) &&
37163726
// If a parent symbol is an anonymous type, don't write it.
37173727
!(symbol.flags & (SymbolFlags.TypeLiteral | SymbolFlags.ObjectLiteral))) {
37183728

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module clodule {
2222

2323
// error: duplicate identifier expected
2424
export function fn<T>(x: T, y: T): T {
25-
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
25+
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
2626
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
2727
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
2828
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndGenericClassStaticFunctionOfTheSameName.ts, 9, 23))

tests/baselines/reference/ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module clodule {
2020

2121
// error: duplicate identifier expected
2222
export function fn<T>(x: T, y: T): T {
23-
>fn : Symbol(clodule.fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
23+
>fn : Symbol(fn, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 7, 16))
2424
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))
2525
>x : Symbol(x, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 26))
2626
>T : Symbol(T, Decl(ClassAndModuleThatMergeWithModulesExportedGenericFunctionAndNonGenericClassStaticFunctionOfTheSameName.ts, 9, 23))

tests/baselines/reference/ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Point {
1717
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 4, 1))
1818

1919
export function Origin() { return null; } //expected duplicate identifier error
20-
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 6, 14))
20+
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 6, 14))
2121
}
2222

2323

@@ -42,6 +42,6 @@ module A {
4242
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 16, 5))
4343

4444
export function Origin() { return ""; }//expected duplicate identifier error
45-
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 18, 25))
45+
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticFunctionAndExportedFunctionThatShareAName.ts, 18, 25))
4646
}
4747
}

tests/baselines/reference/ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module Point {
1717
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 0, 0), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 4, 1))
1818

1919
export var Origin = ""; //expected duplicate identifier error
20-
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 7, 14))
20+
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 7, 14))
2121
}
2222

2323

@@ -42,6 +42,6 @@ module A {
4242
>Point : Symbol(Point, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 11, 10), Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 16, 5))
4343

4444
export var Origin = ""; //expected duplicate identifier error
45-
>Origin : Symbol(Point.Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 19, 18))
45+
>Origin : Symbol(Origin, Decl(ClassAndModuleThatMergeWithStaticVariableAndExportedVarThatShareAName.ts, 19, 18))
4646
}
4747
}

tests/baselines/reference/TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.symbols

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ module A{
1818

1919
// expected error
2020
export class Point {
21-
>Point : Symbol(A.Point, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 7, 9))
21+
>Point : Symbol(Point, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 7, 9))
2222

2323
origin: number;
24-
>origin : Symbol(A.Point.origin, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 9, 24))
24+
>origin : Symbol(Point.origin, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 9, 24))
2525

2626
angle: number;
27-
>angle : Symbol(A.Point.angle, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 10, 23))
27+
>angle : Symbol(Point.angle, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 10, 23))
2828
}
2929
}
3030

@@ -52,10 +52,10 @@ module X {
5252

5353
// expected error
5454
export class Line {
55-
>Line : Symbol(Z.Line, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 23, 25))
55+
>Line : Symbol(Line, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 23, 25))
5656

5757
name: string;
58-
>name : Symbol(Z.Line.name, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 25, 31))
58+
>name : Symbol(Line.name, Decl(TwoInternalModulesThatMergeEachWithExportedClassesOfTheSameName.ts, 25, 31))
5959
}
6060
}
6161
}

tests/baselines/reference/augmentedClassWithPrototypePropertyOnModule.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ declare module m {
66
>f : Symbol(f, Decl(augmentedClassWithPrototypePropertyOnModule.ts, 1, 7))
77

88
var prototype; // This should be error since prototype would be static property on class m
9-
>prototype : Symbol(m.prototype, Decl(augmentedClassWithPrototypePropertyOnModule.ts, 2, 7))
9+
>prototype : Symbol(prototype, Decl(augmentedClassWithPrototypePropertyOnModule.ts, 2, 7))
1010
}
1111
declare class m {
1212
>m : Symbol(m, Decl(augmentedClassWithPrototypePropertyOnModule.ts, 0, 0), Decl(augmentedClassWithPrototypePropertyOnModule.ts, 3, 1))

tests/baselines/reference/cloduleWithDuplicateMember1.symbols

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ module C {
1818
>C : Symbol(C, Decl(cloduleWithDuplicateMember1.ts, 0, 0), Decl(cloduleWithDuplicateMember1.ts, 6, 1), Decl(cloduleWithDuplicateMember1.ts, 10, 1))
1919

2020
export var x = 1;
21-
>x : Symbol(C.x, Decl(cloduleWithDuplicateMember1.ts, 9, 14))
21+
>x : Symbol(x, Decl(cloduleWithDuplicateMember1.ts, 9, 14))
2222
}
2323
module C {
2424
>C : Symbol(C, Decl(cloduleWithDuplicateMember1.ts, 0, 0), Decl(cloduleWithDuplicateMember1.ts, 6, 1), Decl(cloduleWithDuplicateMember1.ts, 10, 1))
2525

2626
export function foo() { }
27-
>foo : Symbol(C.foo, Decl(cloduleWithDuplicateMember1.ts, 11, 10))
27+
>foo : Symbol(foo, Decl(cloduleWithDuplicateMember1.ts, 11, 10))
2828

2929
export function x() { }
30-
>x : Symbol(C.x, Decl(cloduleWithDuplicateMember1.ts, 12, 29))
30+
>x : Symbol(x, Decl(cloduleWithDuplicateMember1.ts, 12, 29))
3131
}

tests/baselines/reference/cloduleWithDuplicateMember2.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ module C {
2121
>C : Symbol(C, Decl(cloduleWithDuplicateMember2.ts, 0, 0), Decl(cloduleWithDuplicateMember2.ts, 3, 1), Decl(cloduleWithDuplicateMember2.ts, 7, 1))
2222

2323
export function x() { }
24-
>x : Symbol(C.x, Decl(cloduleWithDuplicateMember2.ts, 8, 10))
24+
>x : Symbol(x, Decl(cloduleWithDuplicateMember2.ts, 8, 10))
2525
}

tests/baselines/reference/constructorOverloads4.symbols

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ declare module M {
33
>M : Symbol(M, Decl(constructorOverloads4.ts, 0, 0))
44

55
export class Function {
6-
>Function : Symbol(M.Function, Decl(constructorOverloads4.ts, 0, 18))
6+
>Function : Symbol(Function, Decl(constructorOverloads4.ts, 0, 18))
77

88
constructor(...args: string[]);
99
>args : Symbol(args, Decl(constructorOverloads4.ts, 2, 20))

tests/baselines/reference/constructorOverloads5.symbols

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
>RegExp : Symbol(RegExp, Decl(lib.d.ts, --, --), Decl(lib.d.ts, --, --))
1818

1919
export class RegExp {
20-
>RegExp : Symbol(M.RegExp, Decl(constructorOverloads5.ts, 4, 67))
20+
>RegExp : Symbol(RegExp, Decl(constructorOverloads5.ts, 4, 67))
2121

2222
constructor(pattern: string);
2323
>pattern : Symbol(pattern, Decl(constructorOverloads5.ts, 6, 20))
@@ -27,27 +27,27 @@
2727
>flags : Symbol(flags, Decl(constructorOverloads5.ts, 7, 36))
2828

2929
exec(string: string): string[];
30-
>exec : Symbol(M.RegExp.exec, Decl(constructorOverloads5.ts, 7, 52))
30+
>exec : Symbol(RegExp.exec, Decl(constructorOverloads5.ts, 7, 52))
3131
>string : Symbol(string, Decl(constructorOverloads5.ts, 8, 13))
3232

3333
test(string: string): boolean;
34-
>test : Symbol(M.RegExp.test, Decl(constructorOverloads5.ts, 8, 39))
34+
>test : Symbol(RegExp.test, Decl(constructorOverloads5.ts, 8, 39))
3535
>string : Symbol(string, Decl(constructorOverloads5.ts, 9, 13))
3636

3737
source: string;
38-
>source : Symbol(M.RegExp.source, Decl(constructorOverloads5.ts, 9, 38))
38+
>source : Symbol(RegExp.source, Decl(constructorOverloads5.ts, 9, 38))
3939

4040
global: boolean;
41-
>global : Symbol(M.RegExp.global, Decl(constructorOverloads5.ts, 10, 23))
41+
>global : Symbol(RegExp.global, Decl(constructorOverloads5.ts, 10, 23))
4242

4343
ignoreCase: boolean;
44-
>ignoreCase : Symbol(M.RegExp.ignoreCase, Decl(constructorOverloads5.ts, 11, 24))
44+
>ignoreCase : Symbol(RegExp.ignoreCase, Decl(constructorOverloads5.ts, 11, 24))
4545

4646
multiline: boolean;
47-
>multiline : Symbol(M.RegExp.multiline, Decl(constructorOverloads5.ts, 12, 28))
47+
>multiline : Symbol(RegExp.multiline, Decl(constructorOverloads5.ts, 12, 28))
4848

4949
lastIndex: boolean;
50-
>lastIndex : Symbol(M.RegExp.lastIndex, Decl(constructorOverloads5.ts, 13, 27))
50+
>lastIndex : Symbol(RegExp.lastIndex, Decl(constructorOverloads5.ts, 13, 27))
5151
}
5252
}
5353

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//// [tests/cases/compiler/declarationEmitForTypesWhichNeedImportTypes.ts] ////
2+
3+
//// [b.ts]
4+
export interface Named {}
5+
6+
export function createNamed(): Named {
7+
return {};
8+
}
9+
//// [a.ts]
10+
import { createNamed } from "./b";
11+
12+
export const Value = createNamed();
13+
14+
15+
//// [b.js]
16+
"use strict";
17+
exports.__esModule = true;
18+
function createNamed() {
19+
return {};
20+
}
21+
exports.createNamed = createNamed;
22+
//// [a.js]
23+
"use strict";
24+
exports.__esModule = true;
25+
var b_1 = require("./b");
26+
exports.Value = b_1.createNamed();
27+
28+
29+
//// [b.d.ts]
30+
export interface Named {
31+
}
32+
export declare function createNamed(): Named;
33+
//// [a.d.ts]
34+
export declare const Value: import("./b").Named;
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
=== tests/cases/compiler/b.ts ===
2+
export interface Named {}
3+
>Named : Symbol(Named, Decl(b.ts, 0, 0))
4+
5+
export function createNamed(): Named {
6+
>createNamed : Symbol(createNamed, Decl(b.ts, 0, 25))
7+
>Named : Symbol(Named, Decl(b.ts, 0, 0))
8+
9+
return {};
10+
}
11+
=== tests/cases/compiler/a.ts ===
12+
import { createNamed } from "./b";
13+
>createNamed : Symbol(createNamed, Decl(a.ts, 0, 8))
14+
15+
export const Value = createNamed();
16+
>Value : Symbol(Value, Decl(a.ts, 2, 12))
17+
>createNamed : Symbol(createNamed, Decl(a.ts, 0, 8))
18+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/b.ts ===
2+
export interface Named {}
3+
>Named : Named
4+
5+
export function createNamed(): Named {
6+
>createNamed : () => Named
7+
>Named : Named
8+
9+
return {};
10+
>{} : {}
11+
}
12+
=== tests/cases/compiler/a.ts ===
13+
import { createNamed } from "./b";
14+
>createNamed : () => import("tests/cases/compiler/b").Named
15+
16+
export const Value = createNamed();
17+
>Value : import("tests/cases/compiler/b").Named
18+
>createNamed() : import("tests/cases/compiler/b").Named
19+
>createNamed : () => import("tests/cases/compiler/b").Named
20+

tests/baselines/reference/declarationEmitImportInExportAssignmentModule.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ module m {
33
>m : Symbol(m, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 0))
44

55
export module c {
6-
>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 10))
6+
>c : Symbol(c, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 10))
77

88
export class c {
99
>c : Symbol(c, Decl(declarationEmitImportInExportAssignmentModule.ts, 1, 21))
1010
}
1111
}
1212
import x = c;
1313
>x : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 4, 5))
14-
>c : Symbol(x, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 10))
14+
>c : Symbol(c, Decl(declarationEmitImportInExportAssignmentModule.ts, 0, 10))
1515

1616
export var a: typeof x;
1717
>a : Symbol(a, Decl(declarationEmitImportInExportAssignmentModule.ts, 6, 14))

tests/baselines/reference/declarationEmitImportInExportAssignmentModule.types

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ module m {
33
>m : typeof m
44

55
export module c {
6-
>c : typeof x
6+
>c : typeof m.c
77

88
export class c {
99
>c : c
1010
}
1111
}
1212
import x = c;
13-
>x : typeof x
14-
>c : typeof x
13+
>x : typeof c
14+
>c : typeof c
1515

1616
export var a: typeof x;
17-
>a : typeof x
18-
>x : typeof x
17+
>a : typeof c
18+
>x : typeof c
1919
}
2020
export = m;
2121
>m : typeof m

tests/baselines/reference/defaultDeclarationEmitShadowedNamedCorrectly.symbols

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export interface Things<P, T> {
1616
>T : Symbol(T, Decl(this.ts, 1, 26))
1717
}
1818
export function make<P, CTor>(x: { new (): CTor & {props: P} }): Things<P, CTor> {
19-
>make : Symbol(me.make, Decl(this.ts, 4, 1))
19+
>make : Symbol(make, Decl(this.ts, 4, 1))
2020
>P : Symbol(P, Decl(this.ts, 5, 21))
2121
>CTor : Symbol(CTor, Decl(this.ts, 5, 23))
2222
>x : Symbol(x, Decl(this.ts, 5, 30))
@@ -49,7 +49,7 @@ export namespace Something {
4949

5050
export const create = make(me.default);
5151
>create : Symbol(create, Decl(this.ts, 17, 16))
52-
>make : Symbol(me.make, Decl(this.ts, 4, 1))
52+
>make : Symbol(make, Decl(this.ts, 4, 1))
5353
>me.default : Symbol(me.default, Decl(this.ts, 10, 1))
5454
>me : Symbol(me, Decl(this.ts, 0, 6))
5555
>default : Symbol(me.default, Decl(this.ts, 10, 1))

tests/baselines/reference/defaultExportsCannotMerge04.types

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ interface Foo {
1515
}
1616

1717
export interface Foo {
18-
>Foo : Foo
18+
>Foo : import("tests/cases/conformance/es6/modules/defaultExportsCannotMerge04").Foo
1919
}

0 commit comments

Comments
 (0)