From 0066b027724a31657cddff003d3bde45d2b3014b Mon Sep 17 00:00:00 2001 From: Anders Hejlsberg Date: Tue, 1 May 2018 13:06:19 -0700 Subject: [PATCH] Accept new baselines --- .../nonPrimitiveAndTypeVariables.errors.txt | 4 ++-- .../reference/nonPrimitiveAndTypeVariables.js | 6 ++++-- .../nonPrimitiveAndTypeVariables.symbols | 16 +++++++++------- .../reference/nonPrimitiveAndTypeVariables.types | 10 ++++++++-- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/tests/baselines/reference/nonPrimitiveAndTypeVariables.errors.txt b/tests/baselines/reference/nonPrimitiveAndTypeVariables.errors.txt index 27bd17410ac..83ce98f1cd6 100644 --- a/tests/baselines/reference/nonPrimitiveAndTypeVariables.errors.txt +++ b/tests/baselines/reference/nonPrimitiveAndTypeVariables.errors.txt @@ -9,8 +9,8 @@ tests/cases/conformance/types/nonPrimitive/nonPrimitiveAndTypeVariables.ts(11,9) type A = { [P in keyof T]: T[P] extends V ? 1 : 0; }; type B = { [P in keyof T]: T[P] extends V | object ? 1 : 0; }; - type a = A<{ a: 0 | 1 }, 0>; // { a: 0; } - type b = B<{ a: 0 | 1 }, 0>; // { a: 0; } + let a: A<{ a: 0 | 1 }, 0> = { a: 0 }; + let b: B<{ a: 0 | 1 }, 0> = { a: 0 }; function foo(x: T) { let a: object = x; // Error diff --git a/tests/baselines/reference/nonPrimitiveAndTypeVariables.js b/tests/baselines/reference/nonPrimitiveAndTypeVariables.js index 6260624706c..fda272c1fe2 100644 --- a/tests/baselines/reference/nonPrimitiveAndTypeVariables.js +++ b/tests/baselines/reference/nonPrimitiveAndTypeVariables.js @@ -4,8 +4,8 @@ type A = { [P in keyof T]: T[P] extends V ? 1 : 0; }; type B = { [P in keyof T]: T[P] extends V | object ? 1 : 0; }; -type a = A<{ a: 0 | 1 }, 0>; // { a: 0; } -type b = B<{ a: 0 | 1 }, 0>; // { a: 0; } +let a: A<{ a: 0 | 1 }, 0> = { a: 0 }; +let b: B<{ a: 0 | 1 }, 0> = { a: 0 }; function foo(x: T) { let a: object = x; // Error @@ -16,6 +16,8 @@ function foo(x: T) { //// [nonPrimitiveAndTypeVariables.js] "use strict"; // Repros from #23800 +var a = { a: 0 }; +var b = { a: 0 }; function foo(x) { var a = x; // Error var b = x; // Error diff --git a/tests/baselines/reference/nonPrimitiveAndTypeVariables.symbols b/tests/baselines/reference/nonPrimitiveAndTypeVariables.symbols index 791e47c2663..083c67e7fdb 100644 --- a/tests/baselines/reference/nonPrimitiveAndTypeVariables.symbols +++ b/tests/baselines/reference/nonPrimitiveAndTypeVariables.symbols @@ -21,18 +21,20 @@ type B = { [P in keyof T]: T[P] extends V | object ? 1 : 0; }; >P : Symbol(P, Decl(nonPrimitiveAndTypeVariables.ts, 3, 18)) >V : Symbol(V, Decl(nonPrimitiveAndTypeVariables.ts, 3, 9)) -type a = A<{ a: 0 | 1 }, 0>; // { a: 0; } ->a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 3, 68)) +let a: A<{ a: 0 | 1 }, 0> = { a: 0 }; +>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 3)) >A : Symbol(A, Decl(nonPrimitiveAndTypeVariables.ts, 0, 0)) ->a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 12)) +>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 10)) +>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 5, 29)) -type b = B<{ a: 0 | 1 }, 0>; // { a: 0; } ->b : Symbol(b, Decl(nonPrimitiveAndTypeVariables.ts, 5, 28)) +let b: B<{ a: 0 | 1 }, 0> = { a: 0 }; +>b : Symbol(b, Decl(nonPrimitiveAndTypeVariables.ts, 6, 3)) >B : Symbol(B, Decl(nonPrimitiveAndTypeVariables.ts, 2, 59)) ->a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 6, 12)) +>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 6, 10)) +>a : Symbol(a, Decl(nonPrimitiveAndTypeVariables.ts, 6, 29)) function foo(x: T) { ->foo : Symbol(foo, Decl(nonPrimitiveAndTypeVariables.ts, 6, 28)) +>foo : Symbol(foo, Decl(nonPrimitiveAndTypeVariables.ts, 6, 37)) >T : Symbol(T, Decl(nonPrimitiveAndTypeVariables.ts, 8, 13)) >U : Symbol(U, Decl(nonPrimitiveAndTypeVariables.ts, 8, 15)) >x : Symbol(x, Decl(nonPrimitiveAndTypeVariables.ts, 8, 19)) diff --git a/tests/baselines/reference/nonPrimitiveAndTypeVariables.types b/tests/baselines/reference/nonPrimitiveAndTypeVariables.types index 76755f5a9a1..f2fba120140 100644 --- a/tests/baselines/reference/nonPrimitiveAndTypeVariables.types +++ b/tests/baselines/reference/nonPrimitiveAndTypeVariables.types @@ -21,15 +21,21 @@ type B = { [P in keyof T]: T[P] extends V | object ? 1 : 0; }; >P : P >V : V -type a = A<{ a: 0 | 1 }, 0>; // { a: 0; } +let a: A<{ a: 0 | 1 }, 0> = { a: 0 }; >a : A<{ a: 0 | 1; }, 0> >A : A >a : 0 | 1 +>{ a: 0 } : { a: 0; } +>a : 0 +>0 : 0 -type b = B<{ a: 0 | 1 }, 0>; // { a: 0; } +let b: B<{ a: 0 | 1 }, 0> = { a: 0 }; >b : B<{ a: 0 | 1; }, 0> >B : B >a : 0 | 1 +>{ a: 0 } : { a: 0; } +>a : 0 +>0 : 0 function foo(x: T) { >foo : (x: T) => void