Skip to content

Commit c95d76f

Browse files
committed
Fix import type printouts
1 parent 78626ca commit c95d76f

5 files changed

+15
-15
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4370,7 +4370,7 @@ namespace ts {
43704370
return [symbol!];
43714371
}
43724372
}
4373-
if (symbolFromSymbolTable.flags & SymbolFlags.TypeAlias && isAccessible(symbolFromSymbolTable, getDeclaredTypeOfTypeAlias(symbolFromSymbolTable).symbol)) {
4373+
if (meaning !== SymbolFlags.Value && symbolFromSymbolTable.flags & SymbolFlags.TypeAlias && isAccessible(symbolFromSymbolTable, getDeclaredTypeOfTypeAlias(symbolFromSymbolTable).symbol)) {
43744374
return [symbolFromSymbolTable];
43754375
}
43764376
});

tests/baselines/reference/checkJsTypeDefNoUnusedLocalMarked.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export = Foo;
2323

2424
module.exports = /** @type {FooFun} */(void 0);
2525
>module.exports = /** @type {FooFun} */(void 0) : (foo: Foo) => string
26-
>module.exports : (foo: typeof Foo) => string
27-
>module : { exports: (foo: typeof Foo) => string; }
28-
>exports : (foo: typeof Foo) => string
26+
>module.exports : (foo: typeof import("tests/cases/compiler/file")) => string
27+
>module : { exports: (foo: typeof import("tests/cases/compiler/file")) => string; }
28+
>exports : (foo: typeof import("tests/cases/compiler/file")) => string
2929
>(void 0) : FooFun
3030
>void 0 : undefined
3131
>0 : 0

tests/baselines/reference/importTypeInJSDoc.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ a = new Foo({doer: Foo.Bar});
4646
>a = new Foo({doer: Foo.Bar}) : Foo
4747
>a : Foo
4848
>new Foo({doer: Foo.Bar}) : Foo
49-
>Foo : typeof Foo
49+
>Foo : typeof import("tests/cases/conformance/types/import/externs")
5050
>{doer: Foo.Bar} : { doer: (x: string, y?: number) => void; }
5151
>doer : (x: string, y?: number) => void
5252
>Foo.Bar : (x: string, y?: number) => void
53-
>Foo : typeof Foo
53+
>Foo : typeof import("tests/cases/conformance/types/import/externs")
5454
>Bar : (x: string, y?: number) => void
5555

5656
const q = /** @type {import("./externs").Bar} */({ doer: q => q });

tests/baselines/reference/jsdocTypeReferenceToImportOfClassExpression.types

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ const MW = require("./MW");
88
/** @typedef {number} Cictema */
99

1010
module.exports = class MC {
11-
>module.exports = class MC { watch() { return new MW(this); }} : typeof MW.MC
12-
>module.exports : typeof MW.MC
13-
>module : { exports: typeof MW.MC; }
14-
>exports : typeof MW.MC
15-
>class MC { watch() { return new MW(this); }} : typeof MW.MC
16-
>MC : typeof MW.MC
11+
>module.exports = class MC { watch() { return new MW(this); }} : typeof import("tests/cases/conformance/jsdoc/MC")
12+
>module.exports : typeof import("tests/cases/conformance/jsdoc/MC")
13+
>module : { exports: typeof import("tests/cases/conformance/jsdoc/MC"); }
14+
>exports : typeof import("tests/cases/conformance/jsdoc/MC")
15+
>class MC { watch() { return new MW(this); }} : typeof import("tests/cases/conformance/jsdoc/MC")
16+
>MC : typeof import("tests/cases/conformance/jsdoc/MC")
1717

1818
watch() {
1919
>watch : () => MW

tests/baselines/reference/keyofObjectWithGlobalSymbolIncluded.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
=== tests/cases/compiler/keyofObjectWithGlobalSymbolIncluded.ts ===
22
const obj = {
3-
>obj : { [Q]: ArrayConstructor; }
4-
>{ [Symbol.species]: Array} : { [Q]: ArrayConstructor; }
3+
>obj : { [Symbol.species]: ArrayConstructor; }
4+
>{ [Symbol.species]: Array} : { [Symbol.species]: ArrayConstructor; }
55

66
[Symbol.species]: Array
77
>[Symbol.species] : ArrayConstructor
@@ -14,5 +14,5 @@ const obj = {
1414

1515
type Q = keyof typeof obj;
1616
>Q : unique symbol
17-
>obj : { [Q]: ArrayConstructor; }
17+
>obj : { [Symbol.species]: ArrayConstructor; }
1818

0 commit comments

Comments
 (0)