Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tsc/internal/bundled/libs/lib.es5.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1613,14 +1613,14 @@ type Record<K extends keyof any, T> = {
};

/**
* Exclude from T those types that are assignable to U
* Construct the type of values in T that are not in U
*/
type Exclude<T, U> = T extends U ? never : T;
type Exclude<T, U> = T & not U;

/**
* Extract from T those types that are assignable to U
* Construct the type of values common to T and U
*/
type Extract<T, U> = T extends U ? T : never;
type Extract<T, U> = T & U;

/**
* Construct a type with the properties of T except for those in type K.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
Type 'Matching<TInjectedProps, GetProps<C>>' is not assignable to type 'Shared<TInjectedProps, GetProps<C>>'.
Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type '(string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]) | (number extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & number] extends GetProps<C>[keyof TInjectedProps & number] ? GetProps<C>[keyof TInjectedProps & number] : TInjectedProps[keyof TInjectedProps & number] : GetProps<C>[number]) | (symbol extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & symbol] extends GetProps<C>[keyof TInjectedProps & symbol] ? GetProps<C>[keyof TInjectedProps & symbol] : TInjectedProps[keyof TInjectedProps & symbol] : GetProps<C>[symbol])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.


==== circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts (1 errors) ====
Expand Down Expand Up @@ -79,10 +77,8 @@ circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth
!!! error TS2344: Type 'Matching<TInjectedProps, GetProps<C>>' is not assignable to type 'Shared<TInjectedProps, GetProps<C>>'.
!!! error TS2344: Type 'P extends keyof TInjectedProps ? TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : TInjectedProps[P] : GetProps<C>[P]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'Extract<keyof TInjectedProps, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] extends GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] ? GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>] : TInjectedProps[Extract<keyof TInjectedProps, keyof GetProps<C>>] : GetProps<C>[Extract<keyof TInjectedProps, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type '(Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]) | (Extract<number, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<number, keyof GetProps<C>>] : GetProps<C>[Extract<number, keyof GetProps<C>>]) | (Extract<symbol, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<symbol, keyof GetProps<C>>] : GetProps<C>[Extract<symbol, keyof GetProps<C>>])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'Extract<string, keyof GetProps<C>> extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] extends GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] ? GetProps<C>[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : TInjectedProps[keyof TInjectedProps & Extract<string, keyof GetProps<C>>] : GetProps<C>[Extract<string, keyof GetProps<C>>]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'keyof GetProps<C> & string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] extends GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] ? GetProps<C>[keyof TInjectedProps & keyof GetProps<C> & string] : TInjectedProps[keyof TInjectedProps & keyof GetProps<C> & string] : GetProps<C>[keyof GetProps<C> & string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type '(string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]) | (number extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & number] extends GetProps<C>[keyof TInjectedProps & number] ? GetProps<C>[keyof TInjectedProps & number] : TInjectedProps[keyof TInjectedProps & number] : GetProps<C>[number]) | (symbol extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & symbol] extends GetProps<C>[keyof TInjectedProps & symbol] ? GetProps<C>[keyof TInjectedProps & symbol] : TInjectedProps[keyof TInjectedProps & symbol] : GetProps<C>[symbol])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'string extends keyof TInjectedProps ? TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string] : GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'GetProps<C>[string] | (TInjectedProps[keyof TInjectedProps & string] extends GetProps<C>[keyof TInjectedProps & string] ? GetProps<C>[keyof TInjectedProps & string] : TInjectedProps[keyof TInjectedProps & string])' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.
!!! error TS2344: Type 'GetProps<C>[string]' is not assignable to type '(TInjectedProps[P] extends GetProps<C>[P] ? GetProps<C>[P] : never) | undefined'.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type OverloadDefinitions = { readonly [P in number]: (...args: any[]) => any; };

type OverloadBinder<T extends OverloadDefinitions> = (args: OverloadParameters<T>) => OverloadKeys<T> | undefined;
>OverloadBinder : OverloadBinder<T>
>args : Parameters<{ [P in Extract<keyof T, number>]: T[P]; }[Extract<keyof T, number>]>
>args : Parameters<{ [P in OverloadKeys<T>]: T[P]; }[OverloadKeys<T>]>

type OverloadKeys<T extends OverloadDefinitions> = Extract<keyof T, number>;
>OverloadKeys : OverloadKeys<T>
Expand All @@ -36,7 +36,7 @@ type OverloadFunction<T extends OverloadDefinitions> = UnionToIntersection<T[key

type OverloadBinders<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]: (args: OverloadParameters<T>) => boolean | undefined; };
>OverloadBinders : OverloadBinders<T>
>args : Parameters<{ [P_1 in Extract<keyof T, number>]: T[P_1]; }[Extract<keyof T, number>]>
>args : Parameters<{ [P_1 in OverloadKeys<T>]: T[P_1]; }[OverloadKeys<T>]>

type OverloadDeprecations<T extends OverloadDefinitions> = { [P in OverloadKeys<T>]?: DeprecationOptions; };
>OverloadDeprecations : OverloadDeprecations<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@ const fn1 = <Params>(
><Params>( params: Pick<Params, Exclude<keyof Params, never>>,): Params => params : <Params>(params: Pick<Params, Exclude<keyof Params, never>>) => Params

params: Pick<Params, Exclude<keyof Params, never>>,
>params : Pick<Params, Exclude<keyof Params, never>>
>params : Pick<Params, keyof Params>

): Params => params;
>params : Pick<Params, Exclude<keyof Params, never>>
>params : Pick<Params, keyof Params>

function fn2<T>(x: Exclude<T, never>) {
>fn2 : <T>(x: Exclude<T, never>) => void
>x : Exclude<T, never>
>x : T

var y: T = x;
>y : T
>x : Exclude<T, never>
>x : T

x = y;
>x = y : T
>x : Exclude<T, never>
>x : T
>y : T
}

Expand All @@ -30,27 +30,27 @@ const fn3 = <Params>(
><Params>( params: Pick<Params, Extract<keyof Params, keyof Params>>,): Params => params : <Params>(params: Pick<Params, Extract<keyof Params, keyof Params>>) => Params

params: Pick<Params, Extract<keyof Params, keyof Params>>,
>params : Pick<Params, Extract<keyof Params, keyof Params>>
>params : Pick<Params, keyof Params>

): Params => params;
>params : Pick<Params, Extract<keyof Params, keyof Params>>
>params : Pick<Params, keyof Params>

function fn4<T>(x: Extract<T, T>) {
>fn4 : <T>(x: Extract<T, T>) => void
>x : Extract<T, T>
>x : T

var y: T = x;
>y : T
>x : Extract<T, T>
>x : T

x = y;
>x = y : T
>x : Extract<T, T>
>x : T
>y : T
}

declare var x: Extract<number | string, any>; // Should be `numebr | string` and not `any`
>x : string | number
>x : any

type ExtractWithDefault<T, U, D = never> = T extends U ? T : D;
>ExtractWithDefault : ExtractWithDefault<T, U, D>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,41 @@ const matcher = typeTags<Value>();
matcher({
>matcher({ A: (_) => _.a, B: (_) => "fail",}) : unknown
>matcher : <P extends { readonly [Tag in Tags<"_tag", Value> & string]: (_: Extract<Value, { readonly _tag: Tag; }>) => any; } & { readonly [Tag in Exclude<keyof P, Tags<"_tag", Value>>]: never; }>(fields: P) => unknown
>{ A: (_) => _.a, B: (_) => "fail",} : { A: (_: { _tag: "A"; a: number; }) => number; B: (_: { _tag: "B"; b: number; }) => string; }
>{ A: (_) => _.a, B: (_) => "fail",} : { A: (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number; B: (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string; }

A: (_) => _.a,
>A : (_: { _tag: "A"; a: number; }) => number
>(_) => _.a : (_: { _tag: "A"; a: number; }) => number
>_ : { _tag: "A"; a: number; }
>A : (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number
>(_) => _.a : (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number
>_ : { _tag: "A"; a: number; } & { readonly _tag: "A"; }
>_.a : number
>_ : { _tag: "A"; a: number; }
>_ : { _tag: "A"; a: number; } & { readonly _tag: "A"; }
>a : number

B: (_) => "fail",
>B : (_: { _tag: "B"; b: number; }) => string
>(_) => "fail" : (_: { _tag: "B"; b: number; }) => string
>_ : { _tag: "B"; b: number; }
>B : (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string
>(_) => "fail" : (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string
>_ : { _tag: "B"; b: number; } & { readonly _tag: "B"; }
>"fail" : "fail"

});

matcher({
>matcher({ A: (_) => _.a, B: (_) => "fail", C: (_) => "fail",}) : unknown
>matcher : <P extends { readonly [Tag in Tags<"_tag", Value> & string]: (_: Extract<Value, { readonly _tag: Tag; }>) => any; } & { readonly [Tag in Exclude<keyof P, Tags<"_tag", Value>>]: never; }>(fields: P) => unknown
>{ A: (_) => _.a, B: (_) => "fail", C: (_) => "fail",} : { A: (_: { _tag: "A"; a: number; }) => number; B: (_: { _tag: "B"; b: number; }) => string; C: (_: any) => string; }
>{ A: (_) => _.a, B: (_) => "fail", C: (_) => "fail",} : { A: (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number; B: (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string; C: (_: any) => string; }

A: (_) => _.a,
>A : (_: { _tag: "A"; a: number; }) => number
>(_) => _.a : (_: { _tag: "A"; a: number; }) => number
>_ : { _tag: "A"; a: number; }
>A : (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number
>(_) => _.a : (_: { _tag: "A"; a: number; } & { readonly _tag: "A"; }) => number
>_ : { _tag: "A"; a: number; } & { readonly _tag: "A"; }
>_.a : number
>_ : { _tag: "A"; a: number; }
>_ : { _tag: "A"; a: number; } & { readonly _tag: "A"; }
>a : number

B: (_) => "fail",
>B : (_: { _tag: "B"; b: number; }) => string
>(_) => "fail" : (_: { _tag: "B"; b: number; }) => string
>_ : { _tag: "B"; b: number; }
>B : (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string
>(_) => "fail" : (_: { _tag: "B"; b: number; } & { readonly _tag: "B"; }) => string
>_ : { _tag: "B"; b: number; } & { readonly _tag: "B"; }
>"fail" : "fail"

C: (_) => "fail",
Expand Down

Large diffs are not rendered by default.

Loading
Loading