mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Accept new baselines
This commit is contained in:
@@ -38,6 +38,20 @@ declare let g2: <U>(x: Foo2<U> | Bar2<U>) => Promise<U>;
|
||||
|
||||
g1 = g2;
|
||||
g2 = g1;
|
||||
|
||||
// Repro from #32572
|
||||
|
||||
declare function foo1<T>(obj: string[] & Iterable<T>): T;
|
||||
declare function foo2<T>(obj: string[] & T): T;
|
||||
|
||||
declare let sa: string[];
|
||||
declare let sx: string[] & { extra: number };
|
||||
|
||||
let x1 = foo1(sa); // string
|
||||
let y1 = foo1(sx); // string
|
||||
|
||||
let x2 = foo2(sa); // unknown
|
||||
let y2 = foo2(sx); // { extra: number }
|
||||
|
||||
|
||||
//// [unionAndIntersectionInference3.js]
|
||||
@@ -52,3 +66,7 @@ f1 = f2;
|
||||
f2 = f1;
|
||||
g1 = g2;
|
||||
g2 = g1;
|
||||
let x1 = foo1(sa); // string
|
||||
let y1 = foo1(sx); // string
|
||||
let x2 = foo2(sa); // unknown
|
||||
let y2 = foo2(sx); // { extra: number }
|
||||
|
||||
@@ -161,3 +161,47 @@ g2 = g1;
|
||||
>g2 : Symbol(g2, Decl(unionAndIntersectionInference3.ts, 35, 11))
|
||||
>g1 : Symbol(g1, Decl(unionAndIntersectionInference3.ts, 34, 11))
|
||||
|
||||
// Repro from #32572
|
||||
|
||||
declare function foo1<T>(obj: string[] & Iterable<T>): T;
|
||||
>foo1 : Symbol(foo1, Decl(unionAndIntersectionInference3.ts, 38, 8))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 42, 22))
|
||||
>obj : Symbol(obj, Decl(unionAndIntersectionInference3.ts, 42, 25))
|
||||
>Iterable : Symbol(Iterable, Decl(lib.es2015.iterable.d.ts, --, --))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 42, 22))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 42, 22))
|
||||
|
||||
declare function foo2<T>(obj: string[] & T): T;
|
||||
>foo2 : Symbol(foo2, Decl(unionAndIntersectionInference3.ts, 42, 57))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 43, 22))
|
||||
>obj : Symbol(obj, Decl(unionAndIntersectionInference3.ts, 43, 25))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 43, 22))
|
||||
>T : Symbol(T, Decl(unionAndIntersectionInference3.ts, 43, 22))
|
||||
|
||||
declare let sa: string[];
|
||||
>sa : Symbol(sa, Decl(unionAndIntersectionInference3.ts, 45, 11))
|
||||
|
||||
declare let sx: string[] & { extra: number };
|
||||
>sx : Symbol(sx, Decl(unionAndIntersectionInference3.ts, 46, 11))
|
||||
>extra : Symbol(extra, Decl(unionAndIntersectionInference3.ts, 46, 28))
|
||||
|
||||
let x1 = foo1(sa); // string
|
||||
>x1 : Symbol(x1, Decl(unionAndIntersectionInference3.ts, 48, 3))
|
||||
>foo1 : Symbol(foo1, Decl(unionAndIntersectionInference3.ts, 38, 8))
|
||||
>sa : Symbol(sa, Decl(unionAndIntersectionInference3.ts, 45, 11))
|
||||
|
||||
let y1 = foo1(sx); // string
|
||||
>y1 : Symbol(y1, Decl(unionAndIntersectionInference3.ts, 49, 3))
|
||||
>foo1 : Symbol(foo1, Decl(unionAndIntersectionInference3.ts, 38, 8))
|
||||
>sx : Symbol(sx, Decl(unionAndIntersectionInference3.ts, 46, 11))
|
||||
|
||||
let x2 = foo2(sa); // unknown
|
||||
>x2 : Symbol(x2, Decl(unionAndIntersectionInference3.ts, 51, 3))
|
||||
>foo2 : Symbol(foo2, Decl(unionAndIntersectionInference3.ts, 42, 57))
|
||||
>sa : Symbol(sa, Decl(unionAndIntersectionInference3.ts, 45, 11))
|
||||
|
||||
let y2 = foo2(sx); // { extra: number }
|
||||
>y2 : Symbol(y2, Decl(unionAndIntersectionInference3.ts, 52, 3))
|
||||
>foo2 : Symbol(foo2, Decl(unionAndIntersectionInference3.ts, 42, 57))
|
||||
>sx : Symbol(sx, Decl(unionAndIntersectionInference3.ts, 46, 11))
|
||||
|
||||
|
||||
@@ -94,3 +94,44 @@ g2 = g1;
|
||||
>g2 : <U>(x: Foo2<U> | Bar2<U>) => Promise<U>
|
||||
>g1 : <T>(x: Foo2<T> | Bar2<T>) => Promise<T>
|
||||
|
||||
// Repro from #32572
|
||||
|
||||
declare function foo1<T>(obj: string[] & Iterable<T>): T;
|
||||
>foo1 : <T>(obj: string[] & Iterable<T>) => T
|
||||
>obj : string[] & Iterable<T>
|
||||
|
||||
declare function foo2<T>(obj: string[] & T): T;
|
||||
>foo2 : <T>(obj: string[] & T) => T
|
||||
>obj : string[] & T
|
||||
|
||||
declare let sa: string[];
|
||||
>sa : string[]
|
||||
|
||||
declare let sx: string[] & { extra: number };
|
||||
>sx : string[] & { extra: number; }
|
||||
>extra : number
|
||||
|
||||
let x1 = foo1(sa); // string
|
||||
>x1 : string
|
||||
>foo1(sa) : string
|
||||
>foo1 : <T>(obj: string[] & Iterable<T>) => T
|
||||
>sa : string[]
|
||||
|
||||
let y1 = foo1(sx); // string
|
||||
>y1 : string
|
||||
>foo1(sx) : string
|
||||
>foo1 : <T>(obj: string[] & Iterable<T>) => T
|
||||
>sx : string[] & { extra: number; }
|
||||
|
||||
let x2 = foo2(sa); // unknown
|
||||
>x2 : unknown
|
||||
>foo2(sa) : unknown
|
||||
>foo2 : <T>(obj: string[] & T) => T
|
||||
>sa : string[]
|
||||
|
||||
let y2 = foo2(sx); // { extra: number }
|
||||
>y2 : { extra: number; }
|
||||
>foo2(sx) : { extra: number; }
|
||||
>foo2 : <T>(obj: string[] & T) => T
|
||||
>sx : string[] & { extra: number; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user