mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accept new baselines
This commit is contained in:
@@ -203,4 +203,13 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
|
||||
|
||||
type C2<T, V, E> =
|
||||
T extends object ? { [Q in keyof T]: C2<T[Q], V, E>; } : T;
|
||||
|
||||
// Repro from #28654
|
||||
|
||||
type MaybeTrue<T extends { b: boolean }> = true extends T["b"] ? "yes" : "no";
|
||||
|
||||
type T0 = MaybeTrue<{ b: never }> // "no"
|
||||
type T1 = MaybeTrue<{ b: false }>; // "no"
|
||||
type T2 = MaybeTrue<{ b: true }>; // "yes"
|
||||
type T3 = MaybeTrue<{ b: boolean }>; // "yes"
|
||||
|
||||
@@ -145,6 +145,15 @@ type B2<T, V> =
|
||||
|
||||
type C2<T, V, E> =
|
||||
T extends object ? { [Q in keyof T]: C2<T[Q], V, E>; } : T;
|
||||
|
||||
// Repro from #28654
|
||||
|
||||
type MaybeTrue<T extends { b: boolean }> = true extends T["b"] ? "yes" : "no";
|
||||
|
||||
type T0 = MaybeTrue<{ b: never }> // "no"
|
||||
type T1 = MaybeTrue<{ b: false }>; // "no"
|
||||
type T2 = MaybeTrue<{ b: true }>; // "yes"
|
||||
type T3 = MaybeTrue<{ b: boolean }>; // "yes"
|
||||
|
||||
|
||||
//// [conditionalTypes2.js]
|
||||
@@ -304,3 +313,18 @@ declare type B2<T, V> = T extends object ? T extends any[] ? T : {
|
||||
declare type C2<T, V, E> = T extends object ? {
|
||||
[Q in keyof T]: C2<T[Q], V, E>;
|
||||
} : T;
|
||||
declare type MaybeTrue<T extends {
|
||||
b: boolean;
|
||||
}> = true extends T["b"] ? "yes" : "no";
|
||||
declare type T0 = MaybeTrue<{
|
||||
b: never;
|
||||
}>;
|
||||
declare type T1 = MaybeTrue<{
|
||||
b: false;
|
||||
}>;
|
||||
declare type T2 = MaybeTrue<{
|
||||
b: true;
|
||||
}>;
|
||||
declare type T3 = MaybeTrue<{
|
||||
b: boolean;
|
||||
}>;
|
||||
|
||||
@@ -551,3 +551,31 @@ type C2<T, V, E> =
|
||||
>E : Symbol(E, Decl(conditionalTypes2.ts, 144, 13))
|
||||
>T : Symbol(T, Decl(conditionalTypes2.ts, 144, 8))
|
||||
|
||||
// Repro from #28654
|
||||
|
||||
type MaybeTrue<T extends { b: boolean }> = true extends T["b"] ? "yes" : "no";
|
||||
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
|
||||
>T : Symbol(T, Decl(conditionalTypes2.ts, 149, 15))
|
||||
>b : Symbol(b, Decl(conditionalTypes2.ts, 149, 26))
|
||||
>T : Symbol(T, Decl(conditionalTypes2.ts, 149, 15))
|
||||
|
||||
type T0 = MaybeTrue<{ b: never }> // "no"
|
||||
>T0 : Symbol(T0, Decl(conditionalTypes2.ts, 149, 78))
|
||||
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
|
||||
>b : Symbol(b, Decl(conditionalTypes2.ts, 151, 21))
|
||||
|
||||
type T1 = MaybeTrue<{ b: false }>; // "no"
|
||||
>T1 : Symbol(T1, Decl(conditionalTypes2.ts, 151, 33))
|
||||
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
|
||||
>b : Symbol(b, Decl(conditionalTypes2.ts, 152, 21))
|
||||
|
||||
type T2 = MaybeTrue<{ b: true }>; // "yes"
|
||||
>T2 : Symbol(T2, Decl(conditionalTypes2.ts, 152, 34))
|
||||
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
|
||||
>b : Symbol(b, Decl(conditionalTypes2.ts, 153, 21))
|
||||
|
||||
type T3 = MaybeTrue<{ b: boolean }>; // "yes"
|
||||
>T3 : Symbol(T3, Decl(conditionalTypes2.ts, 153, 33))
|
||||
>MaybeTrue : Symbol(MaybeTrue, Decl(conditionalTypes2.ts, 145, 63))
|
||||
>b : Symbol(b, Decl(conditionalTypes2.ts, 154, 21))
|
||||
|
||||
|
||||
@@ -341,3 +341,28 @@ type C2<T, V, E> =
|
||||
|
||||
T extends object ? { [Q in keyof T]: C2<T[Q], V, E>; } : T;
|
||||
|
||||
// Repro from #28654
|
||||
|
||||
type MaybeTrue<T extends { b: boolean }> = true extends T["b"] ? "yes" : "no";
|
||||
>MaybeTrue : MaybeTrue<T>
|
||||
>b : boolean
|
||||
>true : true
|
||||
|
||||
type T0 = MaybeTrue<{ b: never }> // "no"
|
||||
>T0 : "no"
|
||||
>b : never
|
||||
|
||||
type T1 = MaybeTrue<{ b: false }>; // "no"
|
||||
>T1 : "no"
|
||||
>b : false
|
||||
>false : false
|
||||
|
||||
type T2 = MaybeTrue<{ b: true }>; // "yes"
|
||||
>T2 : "yes"
|
||||
>b : true
|
||||
>true : true
|
||||
|
||||
type T3 = MaybeTrue<{ b: boolean }>; // "yes"
|
||||
>T3 : "yes"
|
||||
>b : boolean
|
||||
|
||||
|
||||
Reference in New Issue
Block a user