From 363e392090d9a6084cbfb61328e16072838a9766 Mon Sep 17 00:00:00 2001 From: Wesley Wigham Date: Thu, 1 Apr 2021 13:13:13 -0700 Subject: [PATCH] Add baselines for test from #43485 --- ...eBigArrayConstraintsPerformance.errors.txt | 20 +++++++++++ ...eVarianceBigArrayConstraintsPerformance.js | 17 ++++++++++ ...anceBigArrayConstraintsPerformance.symbols | 34 +++++++++++++++++++ ...rianceBigArrayConstraintsPerformance.types | 24 +++++++++++++ 4 files changed, 95 insertions(+) create mode 100644 tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.errors.txt create mode 100644 tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js create mode 100644 tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.symbols create mode 100644 tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.errors.txt b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.errors.txt new file mode 100644 index 0000000000000..8f936562109f7 --- /dev/null +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.errors.txt @@ -0,0 +1,20 @@ +tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts(9,5): error TS2322: Type 'Stuff' is not assignable to type 'Stuff'. + Type 'U' is not assignable to type 'T'. + 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'. + + +==== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts (1 errors) ==== + /// + + type Stuff = + T extends keyof JSX.IntrinsicElements + ? JSX.IntrinsicElements[T] + : any; + + function F(p1: Stuff, p2: Stuff) { + p1 = p2; // Error + ~~ +!!! error TS2322: Type 'Stuff' is not assignable to type 'Stuff'. +!!! error TS2322: Type 'U' is not assignable to type 'T'. +!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'. + } \ No newline at end of file diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js new file mode 100644 index 0000000000000..c799ce6c24626 --- /dev/null +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.js @@ -0,0 +1,17 @@ +//// [conditionalTypeVarianceBigArrayConstraintsPerformance.ts] +/// + +type Stuff = + T extends keyof JSX.IntrinsicElements + ? JSX.IntrinsicElements[T] + : any; + +function F(p1: Stuff, p2: Stuff) { + p1 = p2; // Error +} + +//// [conditionalTypeVarianceBigArrayConstraintsPerformance.js] +/// +function F(p1, p2) { + p1 = p2; // Error +} diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.symbols b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.symbols new file mode 100644 index 0000000000000..4ecda5edd63b4 --- /dev/null +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.symbols @@ -0,0 +1,34 @@ +=== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts === +/// + +type Stuff = +>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0)) +>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11)) + + T extends keyof JSX.IntrinsicElements +>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11)) +>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12)) +>IntrinsicElements : Symbol(JSX.IntrinsicElements, Decl(react16.d.ts, 2514, 86)) + + ? JSX.IntrinsicElements[T] +>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12)) +>IntrinsicElements : Symbol(JSX.IntrinsicElements, Decl(react16.d.ts, 2514, 86)) +>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11)) + + : any; + +function F(p1: Stuff, p2: Stuff) { +>F : Symbol(F, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 5, 14)) +>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 11)) +>U : Symbol(U, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 13)) +>p1 : Symbol(p1, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 17)) +>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0)) +>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 11)) +>p2 : Symbol(p2, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 30)) +>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0)) +>U : Symbol(U, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 13)) + + p1 = p2; // Error +>p1 : Symbol(p1, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 17)) +>p2 : Symbol(p2, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 30)) +} diff --git a/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types new file mode 100644 index 0000000000000..d9c8af9b51f7a --- /dev/null +++ b/tests/baselines/reference/conditionalTypeVarianceBigArrayConstraintsPerformance.types @@ -0,0 +1,24 @@ +=== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts === +/// + +type Stuff = +>Stuff : Stuff + + T extends keyof JSX.IntrinsicElements +>JSX : any + + ? JSX.IntrinsicElements[T] +>JSX : any + + : any; + +function F(p1: Stuff, p2: Stuff) { +>F : (p1: Stuff, p2: Stuff) => void +>p1 : Stuff +>p2 : Stuff + + p1 = p2; // Error +>p1 = p2 : Stuff +>p1 : Stuff +>p2 : Stuff +}