Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 1 addition & 3 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6560,9 +6560,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
cb: (context: NodeBuilderContext) => T,
out?: WriterContextOut,
): T | undefined {
const moduleResolverHost = tracker?.trackSymbol ? tracker.moduleResolverHost :
(internalFlags || InternalNodeBuilderFlags.None) & InternalNodeBuilderFlags.DoNotIncludeSymbolChain ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) :
undefined;
const moduleResolverHost = tracker?.moduleResolverHost ?? createBasicNodeBuilderModuleSpecifierResolutionHost(host);
flags = flags || NodeBuilderFlags.None;
const maxTruncationLength = maximumLength ||
(flags & NodeBuilderFlags.NoTruncation ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ export declare function styled(): Color;

=== file2.ts ===
import { styled } from "./file1";
>styled : () => import("color").default
> : ^^^^^^ ^^^^^^^ ^^^^^^^
>styled : () => import("./color").default
> : ^^^^^^ ^^^^^^^^^ ^^^^^^^

export const A = styled();
>A : import("color").default
> : ^^^^^^^^^^^^^^^^^^^^^^^
>styled() : import("color").default
> : ^^^^^^^^^^^^^^^^^^^^^^^
>styled : () => import("color").default
> : ^^^^^^ ^^^^^^^ ^^^^^^^
>A : import("./color").default
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>styled() : import("./color").default
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>styled : () => import("./color").default
> : ^^^^^^ ^^^^^^^^^ ^^^^^^^

4 changes: 2 additions & 2 deletions tests/baselines/reference/allowsImportingTsExtension.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type __A = import("./a.ts").A; // ok

const aPromise = import("./a.ts"); // error
>aPromise : Symbol(aPromise, Decl(b.ts, 4, 5))
>"./a.ts" : Symbol("a", Decl(a.ts, 0, 0))
>"./a.ts" : Symbol("./a.ts", Decl(a.ts, 0, 0))

=== c.ts ===
import type { A } from "./a.d.ts"; // ok
Expand All @@ -40,5 +40,5 @@ type __A = import("./a.d.ts").A; // ok

const aPromise = import("./a.d.ts"); // error
>aPromise : Symbol(aPromise, Decl(c.ts, 4, 5))
>"./a.d.ts" : Symbol("a", Decl(a.ts, 0, 0))
>"./a.d.ts" : Symbol("./a.d.ts", Decl(a.ts, 0, 0))

16 changes: 8 additions & 8 deletions tests/baselines/reference/allowsImportingTsExtension.types
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ type __A = import("./a.ts").A; // ok
> : ^

const aPromise = import("./a.ts"); // error
>aPromise : Promise<typeof import("a")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import("./a.ts") : Promise<typeof import("a")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>aPromise : Promise<typeof import("./a.ts")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import("./a.ts") : Promise<typeof import("./a.ts")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"./a.ts" : "./a.ts"
> : ^^^^^^^^

Expand All @@ -51,10 +51,10 @@ type __A = import("./a.d.ts").A; // ok
> : ^

const aPromise = import("./a.d.ts"); // error
>aPromise : Promise<typeof import("a")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import("./a.d.ts") : Promise<typeof import("a")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>aPromise : Promise<typeof import("./a.d.ts")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>import("./a.d.ts") : Promise<typeof import("./a.d.ts")>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"./a.d.ts" : "./a.d.ts"
> : ^^^^^^^^^^

4 changes: 2 additions & 2 deletions tests/baselines/reference/ambientExportDefaultErrors.types
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export default 2 + 2;
> : ^

export as namespace Foo;
>Foo : typeof import("foo")
> : ^^^^^^^^^^^^^^^^^^^^
>Foo : typeof import("./foo")
> : ^^^^^^^^^^^^^^^^^^^^^^

=== foo2.d.ts ===
export = 2 + 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
=== Class.ts ===
import { Configurable } from "./Configurable"
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^

export class HiddenClass {}
>HiddenClass : HiddenClass
Expand All @@ -15,7 +15,7 @@ export class ActualClass extends Configurable(HiddenClass) {}
>Configurable(HiddenClass) : HiddenClass
> : ^^^^^^^^^^^
>Configurable : <T extends import("Configurable").Constructor<{}>>(base: T) => T
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^^ ^^^^^^^^^^^ ^^ ^^ ^^^^^
>HiddenClass : typeof HiddenClass
> : ^^^^^^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ export function Timestamped<TBase extends Constructor>(Base: TBase) {
import { wrapClass, Timestamped } from "./wrapClass";
>wrapClass : (param: any) => typeof Wrapped
> : ^ ^^ ^^^^^^^^^^^^^^^^^^^
>Timestamped : <TBase extends import("wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
> : ^ ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Timestamped : <TBase extends import("./wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

export default wrapClass(0);
>wrapClass(0) : typeof Wrapped
Expand Down Expand Up @@ -88,8 +88,8 @@ export class TimestampedUser extends Timestamped(User) {
> : ^^^^^^^^^^^^^^^
>Timestamped(User) : Timestamped<typeof User>.(Anonymous class) & User
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Timestamped : <TBase extends import("wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
> : ^ ^^^^^^^^^ ^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Timestamped : <TBase extends import("./wrapClass").Constructor>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped<any>.(Anonymous class); } & TBase
> : ^ ^^^^^^^^^ ^^^^^^^^^^^^^ ^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>User : typeof User
> : ^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export { foo as "valid 3" } from "./values-valid";
> : ^^^

export * as "valid 4" from "./values-valid";
>"valid 4" : typeof import("values-valid")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"valid 4" : typeof import("./values-valid")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

=== values-bad-import.ts ===
import { foo as "invalid 2" } from "./values-valid";
Expand Down Expand Up @@ -82,8 +82,8 @@ export type { foo as "valid 3" } from "./type-decls-valid";
> : ^^^

export type * as "valid 4" from "./type-decls-valid";
>"valid 4" : typeof import("type-decls-valid")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>"valid 4" : typeof import("./type-decls-valid")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

=== type-decls-bad-import.ts ===
import type { foo as "invalid 2" } from "./type-decls-valid";
Expand Down
4 changes: 2 additions & 2 deletions tests/baselines/reference/assignmentToVoidZero1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
// #38552
exports.y = exports.x = void 0;
>exports.y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>exports : Symbol("./assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>y : Symbol(y, Decl(assignmentToVoidZero1.js, 2, 14))
>exports.x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))
>exports : Symbol("assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>exports : Symbol("./assignmentToVoidZero1", Decl(assignmentToVoidZero1.js, 0, 0))
>x : Symbol(x, Decl(assignmentToVoidZero1.js, 1, 31))

exports.x = 1;
Expand Down
16 changes: 8 additions & 8 deletions tests/baselines/reference/assignmentToVoidZero1.types
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ exports.y = exports.x = void 0;
> : ^^^^^^^^^
>exports.y : 2
> : ^
>exports : typeof import("assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>y : 2
> : ^
>exports.x = void 0 : undefined
> : ^^^^^^^^^
>exports.x : 1
> : ^
>exports : typeof import("assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>x : 1
> : ^
>void 0 : undefined
Expand All @@ -29,8 +29,8 @@ exports.x = 1;
> : ^
>exports.x : 1
> : ^
>exports : typeof import("assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>x : 1
> : ^
>1 : 1
Expand All @@ -41,8 +41,8 @@ exports.y = 2;
> : ^
>exports.y : 2
> : ^
>exports : typeof import("assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>y : 2
> : ^
>2 : 2
Expand Down
2 changes: 1 addition & 1 deletion tests/baselines/reference/assignmentToVoidZero2.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports.j = 1;
>j : Symbol(j, Decl(assignmentToVoidZero2.js, 0, 0))

exports.k = void 0;
>exports : Symbol("assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0))
>exports : Symbol("./assignmentToVoidZero2", Decl(assignmentToVoidZero2.js, 0, 0))

var o = {}
>o : Symbol(o, Decl(assignmentToVoidZero2.js, 2, 3), Decl(assignmentToVoidZero2.js, 2, 10))
Expand Down
8 changes: 4 additions & 4 deletions tests/baselines/reference/assignmentToVoidZero2.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ exports.j = 1;
> : ^
>exports.j : 1
> : ^
>exports : typeof import("assignmentToVoidZero2")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero2")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>j : 1
> : ^
>1 : 1
Expand All @@ -18,8 +18,8 @@ exports.k = void 0;
> : ^^^^^^^^^
>exports.k : any
> : ^^^
>exports : typeof import("assignmentToVoidZero2")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>exports : typeof import("./assignmentToVoidZero2")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>k : any
> : ^^^
>void 0 : undefined
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/augmentExportEquals3.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

=== file1.ts ===
function foo() {}
>foo : typeof import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("./file1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^

namespace foo {
>foo : typeof import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("./file1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^

export var v = 1;
>v : number
Expand All @@ -16,8 +16,8 @@ namespace foo {
> : ^
}
export = foo;
>foo : typeof import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("./file1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^

=== file2.ts ===
import x = require("./file1");
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/augmentExportEquals3_1.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ declare module "file1" {
> : ^^^^^^^^^^^^^^^^^^^^^^

function foo(): void;
>foo : typeof import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("file1")
> : ^^^^^^^^^^^^^^^^^^^^^^

namespace foo {
>foo : typeof import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("file1")
> : ^^^^^^^^^^^^^^^^^^^^^^

export var v: number;
>v : number
> : ^^^^^^
}
export = foo;
>foo : typeof import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("file1")
> : ^^^^^^^^^^^^^^^^^^^^^^
}


Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/augmentExportEquals4.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

=== file1.ts ===
class foo {}
>foo : import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^
>foo : import("./file1")
> : ^^^^^^^^^^^^^^^^^

namespace foo {
>foo : typeof import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("./file1")
> : ^^^^^^^^^^^^^^^^^^^^^^^^

export var v = 1;
>v : number
Expand All @@ -16,8 +16,8 @@ namespace foo {
> : ^
}
export = foo;
>foo : import("file1.ts")
> : ^^^^^^^^^^^^^^^^^^
>foo : import("./file1")
> : ^^^^^^^^^^^^^^^^^

=== file2.ts ===
import x = require("./file1");
Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/augmentExportEquals4_1.types
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,20 @@ declare module "file1" {
> : ^^^^^^^^^^^^^^^^^^^^^^

class foo {}
>foo : import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^
>foo : import("file1")
> : ^^^^^^^^^^^^^^^

namespace foo {
>foo : typeof import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : typeof import("file1")
> : ^^^^^^^^^^^^^^^^^^^^^^

export var v: number;
>v : number
> : ^^^^^^
}
export = foo;
>foo : import("file1.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^
>foo : import("file1")
> : ^^^^^^^^^^^^^^^
}


Expand Down
12 changes: 6 additions & 6 deletions tests/baselines/reference/augmentExportEquals5.types
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ declare module "express" {
> : ^^^^^^^^^^^^^^^^^^^^^^^^

function e(): e.Express;
>e : typeof import("express.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>e : typeof import("express")
> : ^^^^^^^^^^^^^^^^^^^^^^^^
>e : any
> : ^^^

namespace e {
>e : typeof import("express.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>e : typeof import("express")
> : ^^^^^^^^^^^^^^^^^^^^^^^^

interface IRoute {
all(...handler: RequestHandler[]): IRoute;
Expand Down Expand Up @@ -129,8 +129,8 @@ declare module "express" {
}

export = e;
>e : typeof import("express.d.ts")
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>e : typeof import("express")
> : ^^^^^^^^^^^^^^^^^^^^^^^^
}

=== augmentation.ts ===
Expand Down
Loading
Loading