mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 01:49:57 -05:00
Accept new baselines
This commit is contained in:
@@ -393,4 +393,15 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(243,9): error TS2
|
||||
var z: T1;
|
||||
var z: T2;
|
||||
}
|
||||
|
||||
// Repro from #21863
|
||||
|
||||
function f40() {
|
||||
type Eq<T, U> = T extends U ? U extends T ? true : false : false;
|
||||
type If<S, T, U> = S extends false ? U : T;
|
||||
type Omit<T extends object> = { [P in keyof T]: If<Eq<T[P], never>, never, P>; }[keyof T];
|
||||
type Omit2<T extends object, U = never> = { [P in keyof T]: If<Eq<T[P], U>, never, P>; }[keyof T];
|
||||
type A = Omit<{ a: void; b: never; }>; // 'a'
|
||||
type B = Omit2<{ a: void; b: never; }>; // 'a'
|
||||
}
|
||||
|
||||
@@ -250,6 +250,17 @@ function f33<T, U>() {
|
||||
var z: T1;
|
||||
var z: T2;
|
||||
}
|
||||
|
||||
// Repro from #21863
|
||||
|
||||
function f40() {
|
||||
type Eq<T, U> = T extends U ? U extends T ? true : false : false;
|
||||
type If<S, T, U> = S extends false ? U : T;
|
||||
type Omit<T extends object> = { [P in keyof T]: If<Eq<T[P], never>, never, P>; }[keyof T];
|
||||
type Omit2<T extends object, U = never> = { [P in keyof T]: If<Eq<T[P], U>, never, P>; }[keyof T];
|
||||
type A = Omit<{ a: void; b: never; }>; // 'a'
|
||||
type B = Omit2<{ a: void; b: never; }>; // 'a'
|
||||
}
|
||||
|
||||
|
||||
//// [conditionalTypes1.js]
|
||||
@@ -325,6 +336,9 @@ function f33() {
|
||||
var z;
|
||||
var z;
|
||||
}
|
||||
// Repro from #21863
|
||||
function f40() {
|
||||
}
|
||||
|
||||
|
||||
//// [conditionalTypes1.d.ts]
|
||||
@@ -495,3 +509,4 @@ declare const convert2: <T>(value: Foo<T>) => Foo<T>;
|
||||
declare function f31<T>(): void;
|
||||
declare function f32<T, U>(): void;
|
||||
declare function f33<T, U>(): void;
|
||||
declare function f40(): void;
|
||||
|
||||
@@ -940,3 +940,65 @@ function f33<T, U>() {
|
||||
>T2 : Symbol(T2, Decl(conditionalTypes1.ts, 246, 25))
|
||||
}
|
||||
|
||||
// Repro from #21863
|
||||
|
||||
function f40() {
|
||||
>f40 : Symbol(f40, Decl(conditionalTypes1.ts, 250, 1))
|
||||
|
||||
type Eq<T, U> = T extends U ? U extends T ? true : false : false;
|
||||
>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 255, 14))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 255, 12))
|
||||
|
||||
type If<S, T, U> = S extends false ? U : T;
|
||||
>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69))
|
||||
>S : Symbol(S, Decl(conditionalTypes1.ts, 256, 12))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 14))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 17))
|
||||
>S : Symbol(S, Decl(conditionalTypes1.ts, 256, 12))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 256, 17))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 256, 14))
|
||||
|
||||
type Omit<T extends object> = { [P in keyof T]: If<Eq<T[P], never>, never, P>; }[keyof T];
|
||||
>Omit : Symbol(Omit, Decl(conditionalTypes1.ts, 256, 47))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14))
|
||||
>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69))
|
||||
>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 257, 37))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 257, 14))
|
||||
|
||||
type Omit2<T extends object, U = never> = { [P in keyof T]: If<Eq<T[P], U>, never, P>; }[keyof T];
|
||||
>Omit2 : Symbol(Omit2, Decl(conditionalTypes1.ts, 257, 94))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 258, 32))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15))
|
||||
>If : Symbol(If, Decl(conditionalTypes1.ts, 255, 69))
|
||||
>Eq : Symbol(Eq, Decl(conditionalTypes1.ts, 254, 16))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49))
|
||||
>U : Symbol(U, Decl(conditionalTypes1.ts, 258, 32))
|
||||
>P : Symbol(P, Decl(conditionalTypes1.ts, 258, 49))
|
||||
>T : Symbol(T, Decl(conditionalTypes1.ts, 258, 15))
|
||||
|
||||
type A = Omit<{ a: void; b: never; }>; // 'a'
|
||||
>A : Symbol(A, Decl(conditionalTypes1.ts, 258, 102))
|
||||
>Omit : Symbol(Omit, Decl(conditionalTypes1.ts, 256, 47))
|
||||
>a : Symbol(a, Decl(conditionalTypes1.ts, 259, 19))
|
||||
>b : Symbol(b, Decl(conditionalTypes1.ts, 259, 28))
|
||||
|
||||
type B = Omit2<{ a: void; b: never; }>; // 'a'
|
||||
>B : Symbol(B, Decl(conditionalTypes1.ts, 259, 42))
|
||||
>Omit2 : Symbol(Omit2, Decl(conditionalTypes1.ts, 257, 94))
|
||||
>a : Symbol(a, Decl(conditionalTypes1.ts, 260, 20))
|
||||
>b : Symbol(b, Decl(conditionalTypes1.ts, 260, 29))
|
||||
}
|
||||
|
||||
|
||||
@@ -1080,3 +1080,69 @@ function f33<T, U>() {
|
||||
>T2 : Foo<T & U>
|
||||
}
|
||||
|
||||
// Repro from #21863
|
||||
|
||||
function f40() {
|
||||
>f40 : () => void
|
||||
|
||||
type Eq<T, U> = T extends U ? U extends T ? true : false : false;
|
||||
>Eq : T extends U ? U extends T ? true : false : false
|
||||
>T : T
|
||||
>U : U
|
||||
>T : T
|
||||
>U : U
|
||||
>U : U
|
||||
>T : T
|
||||
>true : true
|
||||
>false : false
|
||||
>false : false
|
||||
|
||||
type If<S, T, U> = S extends false ? U : T;
|
||||
>If : S extends false ? U : T
|
||||
>S : S
|
||||
>T : T
|
||||
>U : U
|
||||
>S : S
|
||||
>false : false
|
||||
>U : U
|
||||
>T : T
|
||||
|
||||
type Omit<T extends object> = { [P in keyof T]: If<Eq<T[P], never>, never, P>; }[keyof T];
|
||||
>Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T]
|
||||
>T : T
|
||||
>P : P
|
||||
>T : T
|
||||
>If : S extends false ? U : T
|
||||
>Eq : T extends U ? U extends T ? true : false : false
|
||||
>T : T
|
||||
>P : P
|
||||
>P : P
|
||||
>T : T
|
||||
|
||||
type Omit2<T extends object, U = never> = { [P in keyof T]: If<Eq<T[P], U>, never, P>; }[keyof T];
|
||||
>Omit2 : { [P in keyof T]: (T[P] extends U ? U extends T[P] ? true : false : false) extends false ? P : never; }[keyof T]
|
||||
>T : T
|
||||
>U : U
|
||||
>P : P
|
||||
>T : T
|
||||
>If : S extends false ? U : T
|
||||
>Eq : T extends U ? U extends T ? true : false : false
|
||||
>T : T
|
||||
>P : P
|
||||
>U : U
|
||||
>P : P
|
||||
>T : T
|
||||
|
||||
type A = Omit<{ a: void; b: never; }>; // 'a'
|
||||
>A : "a"
|
||||
>Omit : { [P in keyof T]: (T[P] extends never ? boolean : false) extends false ? P : never; }[keyof T]
|
||||
>a : void
|
||||
>b : never
|
||||
|
||||
type B = Omit2<{ a: void; b: never; }>; // 'a'
|
||||
>B : "a"
|
||||
>Omit2 : { [P in keyof T]: (T[P] extends U ? U extends T[P] ? true : false : false) extends false ? P : never; }[keyof T]
|
||||
>a : void
|
||||
>b : never
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user