Accept new baselines

This commit is contained in:
Anders Hejlsberg
2019-05-10 09:56:23 -07:00
parent ee59cee381
commit 1366cc7d2b
4 changed files with 57 additions and 0 deletions

View File

@@ -267,4 +267,10 @@ tests/cases/conformance/types/conditional/conditionalTypes2.ts(75,12): error TS2
};
type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
// Repro from #31326
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
type What = Hmm<{}, { a: string }>
const w: What = { a: 4 };

View File

@@ -188,6 +188,12 @@ type ProductComplementComplement = {
};
type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
// Repro from #31326
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
type What = Hmm<{}, { a: string }>
const w: What = { a: 4 };
//// [conditionalTypes2.js]
@@ -265,6 +271,7 @@ function foo(value) {
toString2(value);
}
}
var w = { a: 4 };
//// [conditionalTypes2.d.ts]
@@ -392,3 +399,10 @@ declare type ProductComplementComplement = {
};
declare type PCCA = ProductComplementComplement['a'];
declare type PCCB = ProductComplementComplement['b'];
declare type Hmm<T, U extends T> = U extends T ? {
[K in keyof U]: number;
} : never;
declare type What = Hmm<{}, {
a: string;
}>;
declare const w: What;

View File

@@ -685,3 +685,25 @@ type PCCB = ProductComplementComplement['b'];
>PCCB : Symbol(PCCB, Decl(conditionalTypes2.ts, 187, 45))
>ProductComplementComplement : Symbol(ProductComplementComplement, Decl(conditionalTypes2.ts, 181, 34))
// Repro from #31326
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
>Hmm : Symbol(Hmm, Decl(conditionalTypes2.ts, 188, 45))
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
>T : Symbol(T, Decl(conditionalTypes2.ts, 192, 9))
>K : Symbol(K, Decl(conditionalTypes2.ts, 192, 44))
>U : Symbol(U, Decl(conditionalTypes2.ts, 192, 11))
type What = Hmm<{}, { a: string }>
>What : Symbol(What, Decl(conditionalTypes2.ts, 192, 76))
>Hmm : Symbol(Hmm, Decl(conditionalTypes2.ts, 188, 45))
>a : Symbol(a, Decl(conditionalTypes2.ts, 193, 21))
const w: What = { a: 4 };
>w : Symbol(w, Decl(conditionalTypes2.ts, 194, 5))
>What : Symbol(What, Decl(conditionalTypes2.ts, 192, 76))
>a : Symbol(a, Decl(conditionalTypes2.ts, 194, 17))

View File

@@ -431,3 +431,18 @@ type PCCA = ProductComplementComplement['a'];
type PCCB = ProductComplementComplement['b'];
>PCCB : Product<"b", 1>
// Repro from #31326
type Hmm<T, U extends T> = U extends T ? { [K in keyof U]: number } : never;
>Hmm : Hmm<T, U>
type What = Hmm<{}, { a: string }>
>What : { a: number; }
>a : string
const w: What = { a: 4 };
>w : { a: number; }
>{ a: 4 } : { a: number; }
>a : number
>4 : 4