Accept new baselines

This commit is contained in:
Anders Hejlsberg 2019-07-17 15:07:36 -07:00
parent c4bad64438
commit de837ed51f
4 changed files with 20 additions and 20 deletions

View file

@ -1,5 +1,5 @@
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(13,24): error TS2345: Argument of type '1' is not assignable to parameter of type 'string'.
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(31,13): error TS2345: Argument of type '42' is not assignable to parameter of type 'never'.
tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts(31,15): error TS2345: Argument of type '42' is not assignable to parameter of type 'never'.
==== tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference.ts (2 errors) ====
@ -33,10 +33,10 @@ tests/cases/conformance/types/typeRelationships/typeInference/unionTypeInference
declare function f4<T>(x: string & T): T;
var d1 = f4("abc");
var d2 = f4(s);
var d3 = f4(42); // Error
~~
const d1 = f4("abc");
const d2 = f4(s);
const d3 = f4(42); // Error
~~
!!! error TS2345: Argument of type '42' is not assignable to parameter of type 'never'.
// Repros from #32434

View file

@ -27,9 +27,9 @@ const c5 = f3("abc"); // never
declare function f4<T>(x: string & T): T;
var d1 = f4("abc");
var d2 = f4(s);
var d3 = f4(42); // Error
const d1 = f4("abc");
const d2 = f4(s);
const d3 = f4(42); // Error
// Repros from #32434

View file

@ -94,23 +94,23 @@ declare function f4<T>(x: string & T): T;
>T : Symbol(T, Decl(unionTypeInference.ts, 26, 20))
>T : Symbol(T, Decl(unionTypeInference.ts, 26, 20))
var d1 = f4("abc");
>d1 : Symbol(d1, Decl(unionTypeInference.ts, 28, 3))
const d1 = f4("abc");
>d1 : Symbol(d1, Decl(unionTypeInference.ts, 28, 5))
>f4 : Symbol(f4, Decl(unionTypeInference.ts, 24, 21))
var d2 = f4(s);
>d2 : Symbol(d2, Decl(unionTypeInference.ts, 29, 3))
const d2 = f4(s);
>d2 : Symbol(d2, Decl(unionTypeInference.ts, 29, 5))
>f4 : Symbol(f4, Decl(unionTypeInference.ts, 24, 21))
>s : Symbol(s, Decl(unionTypeInference.ts, 1, 13))
var d3 = f4(42); // Error
>d3 : Symbol(d3, Decl(unionTypeInference.ts, 30, 3))
const d3 = f4(42); // Error
>d3 : Symbol(d3, Decl(unionTypeInference.ts, 30, 5))
>f4 : Symbol(f4, Decl(unionTypeInference.ts, 24, 21))
// Repros from #32434
declare function foo<T>(x: T | Promise<T>): void;
>foo : Symbol(foo, Decl(unionTypeInference.ts, 30, 16))
>foo : Symbol(foo, Decl(unionTypeInference.ts, 30, 18))
>T : Symbol(T, Decl(unionTypeInference.ts, 34, 21))
>x : Symbol(x, Decl(unionTypeInference.ts, 34, 24))
>T : Symbol(T, Decl(unionTypeInference.ts, 34, 21))
@ -122,7 +122,7 @@ declare let x: false | Promise<true>;
>Promise : Symbol(Promise, Decl(lib.es5.d.ts, --, --))
foo(x);
>foo : Symbol(foo, Decl(unionTypeInference.ts, 30, 16))
>foo : Symbol(foo, Decl(unionTypeInference.ts, 30, 18))
>x : Symbol(x, Decl(unionTypeInference.ts, 35, 11))
declare function bar<T>(x: T, y: string | T): T;

View file

@ -113,19 +113,19 @@ declare function f4<T>(x: string & T): T;
>f4 : <T>(x: string & T) => T
>x : string & T
var d1 = f4("abc");
>d1 : string
const d1 = f4("abc");
>d1 : "abc"
>f4("abc") : "abc"
>f4 : <T>(x: string & T) => T
>"abc" : "abc"
var d2 = f4(s);
const d2 = f4(s);
>d2 : unknown
>f4(s) : unknown
>f4 : <T>(x: string & T) => T
>s : string
var d3 = f4(42); // Error
const d3 = f4(42); // Error
>d3 : any
>f4(42) : any
>f4 : <T>(x: string & T) => T