Update tests

This commit is contained in:
Anders Hejlsberg 2019-06-09 08:00:01 -07:00
parent d4c9f24577
commit 9cc9fb9bd7
6 changed files with 11 additions and 11 deletions

View File

@ -71,7 +71,7 @@ type X3<T> = T extends { a: (x: infer U) => void, b: (x: infer U) => void } ? U
type T50 = X3<{}>; // never
type T51 = X3<{ a: (x: string) => void }>; // never
type T52 = X3<{ a: (x: string) => void, b: (x: string) => void }>; // string
type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>; // string & number
type T53 = X3<{ a: (x: number) => void, b: (x: string) => void }>; // never
type T54 = X3<{ a: (x: number) => void, b: () => void }>; // number
type T60 = infer U; // Error

View File

@ -4,12 +4,12 @@ declare const sym1: unique symbol;
declare const sym2: unique symbol;
type T1 = string & 'a'; // 'a'
type T2 = 'a' & string & 'b'; // 'a' & 'b'
type T2 = 'a' & string & 'b'; // never
type T3 = number & 10; // 10
type T4 = 10 & number & 20; // 10 & 20
type T4 = 10 & number & 20; // never
type T5 = symbol & typeof sym1; // typeof sym1
type T6 = typeof sym1 & symbol & typeof sym2; // typeof sym1 & typeof sym2
type T7 = string & 'a' & number & 10 & symbol & typeof sym1; // 'a' & 10 & typeof sym1
type T6 = typeof sym1 & symbol & typeof sym2; // never
type T7 = string & 'a' & number & 10 & symbol & typeof sym1; // never
type T10 = string & ('a' | 'b'); // 'a' | 'b'
type T11 = (string | number) & ('a' | 10); // 'a' | 10

View File

@ -3,8 +3,8 @@ declare function f<T>(x: { prop: T }): T;
declare const a: { prop: string } & { prop: number };
declare const b: { prop: string & number };
f(a); // string & number
f(b); // string & number
f(a); // never
f(b); // never
// Repro from #18354

View File

@ -27,7 +27,7 @@ type T17 = Shape[void]; // Error
type T18 = Shape[undefined]; // Error
type T19 = Shape[{ x: string }]; // Error
type T20 = Shape[string | number]; // Error
type T21 = Shape[string & number]; // Error
type T21 = Shape[string & number];
type T22 = Shape[string | boolean]; // Error
type T30 = string[]["length"];

View File

@ -19,5 +19,5 @@ var c2: string & { name: string } & number;
var d2: string & { name: string } & number & { name: string };
f2(a2); // string
f2(b2); // string[]
f2(c2); // string & number
f2(d2); // string & number
f2(c2); // never
f2(d2); // never

View File

@ -4,7 +4,7 @@
type T00 = unknown & null; // null
type T01 = unknown & undefined; // undefined
type T02 = unknown & null & undefined; // null & undefined (which becomes never in union)
type T02 = unknown & null & undefined; // never
type T03 = unknown & string; // string
type T04 = unknown & string[]; // string[]
type T05 = unknown & unknown; // unknown