Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add unknown union type to getConstraintOfTypeParameter #2

Closed
wants to merge 1 commit into from
Closed
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: 3 additions & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1576,8 +1576,8 @@
// extra cost of calling `getParseTreeNode` when calling these functions from inside the
// checker.
const checker: TypeChecker = {
getNodeCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.nodeCount, 0),

Check failure on line 1579 in src/compiler/checker.ts

View workflow job for this annotation

GitHub Actions / self-check

Type 'number' is not assignable to type '0'.
getIdentifierCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.identifierCount, 0),

Check failure on line 1580 in src/compiler/checker.ts

View workflow job for this annotation

GitHub Actions / self-check

Type 'number' is not assignable to type '0'.
getSymbolCount: () => reduceLeft(host.getSourceFiles(), (n, s) => n + s.symbolCount, symbolCount),
getTypeCount: () => typeCount,
getInstantiationCount: () => totalInstantiationCount,
Expand Down Expand Up @@ -14535,7 +14535,9 @@
}

function getConstraintOfTypeParameter(typeParameter: TypeParameter): Type | undefined {
return hasNonCircularBaseConstraint(typeParameter) ? getConstraintFromTypeParameter(typeParameter) : undefined;
if (!hasNonCircularBaseConstraint(typeParameter)) return undefined;
const constraint = getConstraintFromTypeParameter(typeParameter);
return constraint === undefined && strictNullChecks ? unknownUnionType : constraint;
}

function isConstMappedType(type: MappedType, depth: number): boolean {
Expand Down
24 changes: 12 additions & 12 deletions tests/baselines/reference/acceptSymbolAsWeakType.types
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@ wr.deref();
> : ^^^^^^^^^^^^^^^^^^^^^^^^

const f = new FinalizationRegistry(() => {});
>f : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>new FinalizationRegistry(() => {}) : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>f : FinalizationRegistry<{} | null | undefined>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>new FinalizationRegistry(() => {}) : FinalizationRegistry<{} | null | undefined>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>FinalizationRegistry : FinalizationRegistryConstructor
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>() => {} : () => void
Expand All @@ -158,12 +158,12 @@ const f = new FinalizationRegistry(() => {});
f.register(s, null);
>f.register(s, null) : void
> : ^^^^
>f.register : (target: WeakKey, heldValue: unknown, unregisterToken?: WeakKey) => void
> : ^ ^^ ^^ ^^^^^^^^^^^ ^^^ ^^^^^
>f : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>register : (target: WeakKey, heldValue: unknown, unregisterToken?: WeakKey) => void
> : ^ ^^ ^^ ^^^^^^^^^^^ ^^^ ^^^^^
>f.register : (target: WeakKey, heldValue: {} | null | undefined, unregisterToken?: WeakKey) => void
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^
>f : FinalizationRegistry<{} | null | undefined>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>register : (target: WeakKey, heldValue: {} | null | undefined, unregisterToken?: WeakKey) => void
> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^ ^^^^^
>s : symbol
> : ^^^^^^

Expand All @@ -172,8 +172,8 @@ f.unregister(s);
> : ^^^^^^^
>f.unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^
>f : FinalizationRegistry<unknown>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>f : FinalizationRegistry<{} | null | undefined>
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>unregister : (unregisterToken: WeakKey) => boolean
> : ^ ^^ ^^^^^
>s : symbol
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ class ErrImpl<E> {
}

declare const Err: typeof ErrImpl & (<T>() => T);
>Err : typeof ErrImpl & (<T>() => T)
> : ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^
>Err : typeof ErrImpl & (<T extends {} | null | undefined>() => T)
> : ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^
>ErrImpl : typeof ErrImpl
> : ^^^^^^^^^^^^^^

type ErrAlias<U> = typeof Err<U>;
>ErrAlias : { new (): ErrImpl<U>; prototype: ErrImpl<any>; } & (() => U)
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>Err : typeof ErrImpl & (<T>() => T)
> : ^^^^^^^^^^^^^^^^^^^ ^^^^^^^ ^
>Err : typeof ErrImpl & (<T extends {} | null | undefined>() => T)
> : ^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^

declare const e: ErrAlias<number>;
>e : { new (): ErrImpl<number>; prototype: ErrImpl<any>; } & (() => number)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ declare class Class<T> {
}

declare function fn<T>(): T;
>fn : <T>() => T
> : ^ ^^^^^^^
>fn : <T extends {} | null | undefined>() => T
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


type ClassAlias<T> = typeof Class<T>;
Expand All @@ -24,8 +24,8 @@ type ClassAlias<T> = typeof Class<T>;
type FnAlias<T> = typeof fn<T>;
>FnAlias : typeof fn<T>
> :
>fn : <T_1>() => T_1
> : ^^^^^^^^^^^
>fn : <T_1 extends {} | null | undefined>() => T_1
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

type Wat<T> = ClassAlias<T> & FnAlias<T>;
>Wat : Wat<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ const debuglog = function() {
return format.apply(null, arguments);
>format.apply(null, arguments) : string
> : ^^^^^^
>format.apply : { <T, R>(this: (this: T) => R, thisArg: T): R; <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; }
> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>format.apply : { <T extends {} | null | undefined, R extends {} | null | undefined>(this: (this: T) => R, thisArg: T): R; <T extends {} | null | undefined, A extends any[], R extends {} | null | undefined>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; }
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>format : (f: any, ...args: any[]) => string
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>apply : { <T, R>(this: (this: T) => R, thisArg: T): R; <T, A extends any[], R>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; }
> : ^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>apply : { <T extends {} | null | undefined, R extends {} | null | undefined>(this: (this: T) => R, thisArg: T): R; <T extends {} | null | undefined, A extends any[], R extends {} | null | undefined>(this: (this: T, ...args: A) => R, thisArg: T, args: A): R; }
> : ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^ ^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^ ^^ ^^^ ^^^
>arguments : IArguments
> : ^^^^^^^^^^

Expand Down

Large diffs are not rendered by default.

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

=== arrayFlatNoCrashInference.ts ===
function foo<T>(arr: T[], depth: number) {
>foo : <T>(arr: T[], depth: number) => FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : <T extends {} | null | undefined>(arr: T[], depth: number) => FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : T[]
> : ^^^
>depth : number
Expand All @@ -12,12 +12,12 @@ function foo<T>(arr: T[], depth: number) {
return arr.flat(depth);
>arr.flat(depth) : FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr.flat : <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr.flat : <A extends {} | null | undefined, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : T[]
> : ^^^
>flat : <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>flat : <A extends {} | null | undefined, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>depth : number
> : ^^^^^^
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

=== arrayFlatNoCrashInferenceDeclarations.ts ===
function foo<T>(arr: T[], depth: number) {
>foo : <T>(arr: T[], depth: number) => FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^ ^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : <T extends {} | null | undefined>(arr: T[], depth: number) => FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : T[]
> : ^^^
>depth : number
Expand All @@ -12,12 +12,12 @@ function foo<T>(arr: T[], depth: number) {
return arr.flat(depth);
>arr.flat(depth) : FlatArray<T, 0 | 1 | -1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20>[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr.flat : <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr.flat : <A extends {} | null | undefined, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>arr : T[]
> : ^^^
>flat : <A, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>flat : <A extends {} | null | undefined, D extends number = 1>(this: A, depth?: D | undefined) => FlatArray<A, D>[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^ ^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>depth : number
> : ^^^^^^
}
12 changes: 6 additions & 6 deletions tests/baselines/reference/arrayLiteralInference.types
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,8 @@ const appTypeStylesWithError: Map<AppType, Array<AppStyle>> = new Map([
// Repro from #31204

declare function foo<T>(...args: T[]): T[];
>foo : <T>(...args: T[]) => T[]
> : ^ ^^^^^ ^^ ^^^^^
>foo : <T extends {} | null | undefined>(...args: T[]) => T[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>args : T[]
> : ^^^

Expand All @@ -192,8 +192,8 @@ let b1: { x: boolean }[] = foo({ x: true }, { x: false });
> : ^^^^^^^
>foo({ x: true }, { x: false }) : ({ x: true; } | { x: false; })[]
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>foo : <T>(...args: T[]) => T[]
> : ^ ^^^^^ ^^ ^^^^^
>foo : <T extends {} | null | undefined>(...args: T[]) => T[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>{ x: true } : { x: true; }
> : ^^^^^^^^^^^^
>x : true
Expand All @@ -212,8 +212,8 @@ let b2: boolean[][] = foo([true], [false]);
> : ^^^^^^^^^^^
>foo([true], [false]) : (true[] | false[])[]
> : ^^^^^^^^^^^^^^^^^^^^
>foo : <T>(...args: T[]) => T[]
> : ^ ^^^^^ ^^ ^^^^^
>foo : <T extends {} | null | undefined>(...args: T[]) => T[]
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>[true] : true[]
> : ^^^^^^
>true : true
Expand Down
16 changes: 8 additions & 8 deletions tests/baselines/reference/assertionFunctionWildcardImport2.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

=== asserts.ts ===
function isNonNullable<T>(obj: T): asserts obj is NonNullable<T> {
>isNonNullable : <T>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>isNonNullable : <T extends {} | null | undefined>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>obj : T
> : ^

Expand Down Expand Up @@ -33,8 +33,8 @@ function isNonNullable<T>(obj: T): asserts obj is NonNullable<T> {

export {
isNonNullable
>isNonNullable : <T>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>isNonNullable : <T extends {} | null | undefined>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^

};

Expand All @@ -52,12 +52,12 @@ function test(obj: string | null): void {
asserts.isNonNullable(obj);
>asserts.isNonNullable(obj) : void
> : ^^^^
>asserts.isNonNullable : <T>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>asserts.isNonNullable : <T extends {} | null | undefined>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>asserts : typeof asserts
> : ^^^^^^^^^^^^^^
>isNonNullable : <T>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>isNonNullable : <T extends {} | null | undefined>(obj: T) => asserts obj is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>obj : string | null
> : ^^^^^^^^^^^^^

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type Animal = Cat | Dog;
> : ^^^^^^

declare function assertEqual<T>(value: any, type: T): asserts value is T;
>assertEqual : <T>(value: any, type: T) => asserts value is T
> : ^ ^^ ^^ ^^ ^^ ^^^^^
>assertEqual : <T extends {} | null | undefined>(value: any, type: T) => asserts value is T
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^
>value : any
>type : T
> : ^
Expand All @@ -55,8 +55,8 @@ const animal = { type: 'cat', canMeow: true } as Animal;
assertEqual(animal.type, 'cat' as const);
>assertEqual(animal.type, 'cat' as const) : void
> : ^^^^
>assertEqual : <T>(value: any, type: T) => asserts value is T
> : ^ ^^ ^^ ^^ ^^ ^^^^^
>assertEqual : <T extends {} | null | undefined>(value: any, type: T) => asserts value is T
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^
>animal.type : "cat" | "dog"
> : ^^^^^^^^^^^^^
>animal : Animal
Expand Down Expand Up @@ -95,8 +95,8 @@ const animalOrUndef = { type: 'cat', canMeow: true } as Animal | undefined;
assertEqual(animalOrUndef?.type, 'cat' as const);
>assertEqual(animalOrUndef?.type, 'cat' as const) : void
> : ^^^^
>assertEqual : <T>(value: any, type: T) => asserts value is T
> : ^ ^^ ^^ ^^ ^^ ^^^^^
>assertEqual : <T extends {} | null | undefined>(value: any, type: T) => asserts value is T
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^ ^^ ^^^^^
>animalOrUndef?.type : "cat" | "dog" | undefined
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
>animalOrUndef : Animal | undefined
Expand Down
24 changes: 12 additions & 12 deletions tests/baselines/reference/assertionTypePredicates1.types
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ declare function assertIsArrayOfStrings(value: unknown): asserts value is string
> : ^^^^^^^

declare function assertDefined<T>(value: T): asserts value is NonNullable<T>;
>assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>value : T
> : ^

Expand Down Expand Up @@ -262,8 +262,8 @@ function f01(x: unknown) {
assertDefined(x);
>assertDefined(x) : void
> : ^^^^
>assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>x : string | undefined
> : ^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -390,8 +390,8 @@ function f02(x: string | undefined) {
assertDefined(x);
>assertDefined(x) : void
> : ^^^^
>assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>x : string | undefined
> : ^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -445,8 +445,8 @@ namespace Debug {
> : ^^^^^^^^^^^^^^^^^^

export declare function assertDefined<T>(value: T): asserts value is NonNullable<T>;
>assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>value : T
> : ^
}
Expand Down Expand Up @@ -528,12 +528,12 @@ function f10(x: string | undefined) {
Debug.assertDefined(x);
>Debug.assertDefined(x) : void
> : ^^^^
>Debug.assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>Debug.assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>Debug : typeof Debug
> : ^^^^^^^^^^^^
>assertDefined : <T>(value: T) => asserts value is NonNullable<T>
> : ^ ^^ ^^ ^^^^^
>assertDefined : <T extends {} | null | undefined>(value: T) => asserts value is NonNullable<T>
> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^
>x : string | undefined
> : ^^^^^^^^^^^^^^^^^^

Expand Down
Loading
Loading