Accept new baselines

This commit is contained in:
Anders Hejlsberg 2019-04-27 09:56:17 -07:00
parent 078375765b
commit 19bdaf8644
3 changed files with 46 additions and 0 deletions

View file

@ -12,6 +12,14 @@ export declare function foo2<T>(obj: T): T extends { [K in keyof BadNested<infer
export function bar2<T>(obj: T) {
return foo2(obj);
}
// Repros from #31099
type Weird = any extends infer U ? U : never;
type AlsoWeird = unknown extends infer U ? U : never;
const a: Weird = null;
const b: string = a;
//// [inferTypes2.js]
@ -26,6 +34,8 @@ function bar2(obj) {
return foo2(obj);
}
exports.bar2 = bar2;
var a = null;
var b = a;
//// [inferTypes2.d.ts]

View file

@ -53,3 +53,23 @@ export function bar2<T>(obj: T) {
>obj : Symbol(obj, Decl(inferTypes2.ts, 10, 24))
}
// Repros from #31099
type Weird = any extends infer U ? U : never;
>Weird : Symbol(Weird, Decl(inferTypes2.ts, 12, 1))
>U : Symbol(U, Decl(inferTypes2.ts, 16, 30))
>U : Symbol(U, Decl(inferTypes2.ts, 16, 30))
type AlsoWeird = unknown extends infer U ? U : never;
>AlsoWeird : Symbol(AlsoWeird, Decl(inferTypes2.ts, 16, 45))
>U : Symbol(U, Decl(inferTypes2.ts, 17, 38))
>U : Symbol(U, Decl(inferTypes2.ts, 17, 38))
const a: Weird = null;
>a : Symbol(a, Decl(inferTypes2.ts, 19, 5))
>Weird : Symbol(Weird, Decl(inferTypes2.ts, 12, 1))
const b: string = a;
>b : Symbol(b, Decl(inferTypes2.ts, 20, 5))
>a : Symbol(a, Decl(inferTypes2.ts, 19, 5))

View file

@ -33,3 +33,19 @@ export function bar2<T>(obj: T) {
>obj : T
}
// Repros from #31099
type Weird = any extends infer U ? U : never;
>Weird : any
type AlsoWeird = unknown extends infer U ? U : never;
>AlsoWeird : unknown
const a: Weird = null;
>a : any
>null : null
const b: string = a;
>b : string
>a : any