Skip to content

Commit 363e392

Browse files
committed
Add baselines for test from microsoft#43485
1 parent 950d0ce commit 363e392

4 files changed

+95
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts(9,5): error TS2322: Type 'Stuff<U>' is not assignable to type 'Stuff<T>'.
2+
Type 'U' is not assignable to type 'T'.
3+
'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
4+
5+
6+
==== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts (1 errors) ====
7+
/// <reference path="/.lib/react16.d.ts" />
8+
9+
type Stuff<T> =
10+
T extends keyof JSX.IntrinsicElements
11+
? JSX.IntrinsicElements[T]
12+
: any;
13+
14+
function F<T, U>(p1: Stuff<T>, p2: Stuff<U>) {
15+
p1 = p2; // Error
16+
~~
17+
!!! error TS2322: Type 'Stuff<U>' is not assignable to type 'Stuff<T>'.
18+
!!! error TS2322: Type 'U' is not assignable to type 'T'.
19+
!!! error TS2322: 'T' could be instantiated with an arbitrary type which could be unrelated to 'U'.
20+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//// [conditionalTypeVarianceBigArrayConstraintsPerformance.ts]
2+
/// <reference path="/.lib/react16.d.ts" />
3+
4+
type Stuff<T> =
5+
T extends keyof JSX.IntrinsicElements
6+
? JSX.IntrinsicElements[T]
7+
: any;
8+
9+
function F<T, U>(p1: Stuff<T>, p2: Stuff<U>) {
10+
p1 = p2; // Error
11+
}
12+
13+
//// [conditionalTypeVarianceBigArrayConstraintsPerformance.js]
14+
/// <reference path="react16.d.ts" />
15+
function F(p1, p2) {
16+
p1 = p2; // Error
17+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
=== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts ===
2+
/// <reference path="react16.d.ts" />
3+
4+
type Stuff<T> =
5+
>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0))
6+
>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11))
7+
8+
T extends keyof JSX.IntrinsicElements
9+
>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11))
10+
>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12))
11+
>IntrinsicElements : Symbol(JSX.IntrinsicElements, Decl(react16.d.ts, 2514, 86))
12+
13+
? JSX.IntrinsicElements[T]
14+
>JSX : Symbol(JSX, Decl(react16.d.ts, 2493, 12))
15+
>IntrinsicElements : Symbol(JSX.IntrinsicElements, Decl(react16.d.ts, 2514, 86))
16+
>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 2, 11))
17+
18+
: any;
19+
20+
function F<T, U>(p1: Stuff<T>, p2: Stuff<U>) {
21+
>F : Symbol(F, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 5, 14))
22+
>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 11))
23+
>U : Symbol(U, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 13))
24+
>p1 : Symbol(p1, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 17))
25+
>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0))
26+
>T : Symbol(T, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 11))
27+
>p2 : Symbol(p2, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 30))
28+
>Stuff : Symbol(Stuff, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 0, 0))
29+
>U : Symbol(U, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 13))
30+
31+
p1 = p2; // Error
32+
>p1 : Symbol(p1, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 17))
33+
>p2 : Symbol(p2, Decl(conditionalTypeVarianceBigArrayConstraintsPerformance.ts, 7, 30))
34+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
=== tests/cases/compiler/conditionalTypeVarianceBigArrayConstraintsPerformance.ts ===
2+
/// <reference path="react16.d.ts" />
3+
4+
type Stuff<T> =
5+
>Stuff : Stuff<T>
6+
7+
T extends keyof JSX.IntrinsicElements
8+
>JSX : any
9+
10+
? JSX.IntrinsicElements[T]
11+
>JSX : any
12+
13+
: any;
14+
15+
function F<T, U>(p1: Stuff<T>, p2: Stuff<U>) {
16+
>F : <T, U>(p1: Stuff<T>, p2: Stuff<U>) => void
17+
>p1 : Stuff<T>
18+
>p2 : Stuff<U>
19+
20+
p1 = p2; // Error
21+
>p1 = p2 : Stuff<U>
22+
>p1 : Stuff<T>
23+
>p2 : Stuff<U>
24+
}

0 commit comments

Comments
 (0)