Skip to content

Commit

Permalink
Accept new baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Jan 10, 2019
1 parent 9fda701 commit 0c1c97e
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/baselines/reference/conditionalTypes1.errors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,12 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS

var a = {o: 1, b: 2, c: [{a: 1, c: '213'}]}
assign(a, {o: 2, c: {0: {a: 2, c: '213123'}}})

// Repros from #23843

type Weird1 = (<U extends boolean>(a: U) => never) extends
(<U extends true>(a: U) => never) ? never : never;

type Weird2 = (<U extends boolean>(a: U) => U) extends
(<U extends true>(a: U) => infer T) ? T : never;

10 changes: 10 additions & 0 deletions tests/baselines/reference/conditionalTypes1.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,14 @@ declare function assign<T>(o: T, a: RecursivePartial<T>): void;

var a = {o: 1, b: 2, c: [{a: 1, c: '213'}]}
assign(a, {o: 2, c: {0: {a: 2, c: '213123'}}})

// Repros from #23843

type Weird1 = (<U extends boolean>(a: U) => never) extends
(<U extends true>(a: U) => never) ? never : never;

type Weird2 = (<U extends boolean>(a: U) => U) extends
(<U extends true>(a: U) => infer T) ? T : never;


//// [conditionalTypes1.js]
Expand Down Expand Up @@ -715,3 +723,5 @@ declare var a: {
c: string;
}[];
};
declare type Weird1 = (<U extends boolean>(a: U) => never) extends (<U extends true>(a: U) => never) ? never : never;
declare type Weird2 = (<U extends boolean>(a: U) => U) extends (<U extends true>(a: U) => infer T) ? T : never;
27 changes: 27 additions & 0 deletions tests/baselines/reference/conditionalTypes1.symbols
Original file line number Diff line number Diff line change
Expand Up @@ -1371,3 +1371,30 @@ assign(a, {o: 2, c: {0: {a: 2, c: '213123'}}})
>a : Symbol(a, Decl(conditionalTypes1.ts, 351, 25))
>c : Symbol(c, Decl(conditionalTypes1.ts, 351, 30))

// Repros from #23843

type Weird1 = (<U extends boolean>(a: U) => never) extends
>Weird1 : Symbol(Weird1, Decl(conditionalTypes1.ts, 351, 46))
>U : Symbol(U, Decl(conditionalTypes1.ts, 355, 16))
>a : Symbol(a, Decl(conditionalTypes1.ts, 355, 35))
>U : Symbol(U, Decl(conditionalTypes1.ts, 355, 16))

(<U extends true>(a: U) => never) ? never : never;
>U : Symbol(U, Decl(conditionalTypes1.ts, 356, 6))
>a : Symbol(a, Decl(conditionalTypes1.ts, 356, 22))
>U : Symbol(U, Decl(conditionalTypes1.ts, 356, 6))

type Weird2 = (<U extends boolean>(a: U) => U) extends
>Weird2 : Symbol(Weird2, Decl(conditionalTypes1.ts, 356, 54))
>U : Symbol(U, Decl(conditionalTypes1.ts, 358, 16))
>a : Symbol(a, Decl(conditionalTypes1.ts, 358, 35))
>U : Symbol(U, Decl(conditionalTypes1.ts, 358, 16))
>U : Symbol(U, Decl(conditionalTypes1.ts, 358, 16))

(<U extends true>(a: U) => infer T) ? T : never;
>U : Symbol(U, Decl(conditionalTypes1.ts, 359, 6))
>a : Symbol(a, Decl(conditionalTypes1.ts, 359, 22))
>U : Symbol(U, Decl(conditionalTypes1.ts, 359, 6))
>T : Symbol(T, Decl(conditionalTypes1.ts, 359, 36))
>T : Symbol(T, Decl(conditionalTypes1.ts, 359, 36))

18 changes: 18 additions & 0 deletions tests/baselines/reference/conditionalTypes1.types
Original file line number Diff line number Diff line change
Expand Up @@ -1054,3 +1054,21 @@ assign(a, {o: 2, c: {0: {a: 2, c: '213123'}}})
>c : string
>'213123' : "213123"

// Repros from #23843

type Weird1 = (<U extends boolean>(a: U) => never) extends
>Weird1 : never
>a : U

(<U extends true>(a: U) => never) ? never : never;
>true : true
>a : U

type Weird2 = (<U extends boolean>(a: U) => U) extends
>Weird2 : boolean
>a : U

(<U extends true>(a: U) => infer T) ? T : never;
>true : true
>a : U

0 comments on commit 0c1c97e

Please sign in to comment.