mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 07:13:45 -05:00
Add regression test
This commit is contained in:
@@ -252,3 +252,14 @@ 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'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user