Skip to content

Commit 2822e99

Browse files
committed
Add an extra test case
1 parent 3bdf36a commit 2822e99

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

tests/baselines/reference/contextualTypeWithTuple.errors.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,9 @@ tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts(25,1): error TS23
7474
type test1 = [...number[]]
7575
type fixed1 = test1 & { length: 2 }
7676
let var1: fixed1 = [0, 0]
77+
78+
// #52551
79+
type EmptyTuple = []
80+
interface MyEmptyTuple extends EmptyTuple { extraInfo?: any; }
81+
const withExtra: MyEmptyTuple = []
7782

tests/baselines/reference/contextualTypeWithTuple.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ numStrTuple = unionTuple3;
2929
type test1 = [...number[]]
3030
type fixed1 = test1 & { length: 2 }
3131
let var1: fixed1 = [0, 0]
32+
33+
// #52551
34+
type EmptyTuple = []
35+
interface MyEmptyTuple extends EmptyTuple { extraInfo?: any; }
36+
const withExtra: MyEmptyTuple = []
3237

3338

3439
//// [contextualTypeWithTuple.js]
@@ -63,3 +68,4 @@ unionTuple = unionTuple2;
6368
unionTuple2 = unionTuple;
6469
numStrTuple = unionTuple3;
6570
var var1 = [0, 0];
71+
var withExtra = [];

tests/baselines/reference/contextualTypeWithTuple.symbols

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,16 @@ let var1: fixed1 = [0, 0]
9393
>var1 : Symbol(var1, Decl(contextualTypeWithTuple.ts, 29, 3))
9494
>fixed1 : Symbol(fixed1, Decl(contextualTypeWithTuple.ts, 27, 26))
9595

96+
// #52551
97+
type EmptyTuple = []
98+
>EmptyTuple : Symbol(EmptyTuple, Decl(contextualTypeWithTuple.ts, 29, 25))
99+
100+
interface MyEmptyTuple extends EmptyTuple { extraInfo?: any; }
101+
>MyEmptyTuple : Symbol(MyEmptyTuple, Decl(contextualTypeWithTuple.ts, 32, 20))
102+
>EmptyTuple : Symbol(EmptyTuple, Decl(contextualTypeWithTuple.ts, 29, 25))
103+
>extraInfo : Symbol(MyEmptyTuple.extraInfo, Decl(contextualTypeWithTuple.ts, 33, 43))
104+
105+
const withExtra: MyEmptyTuple = []
106+
>withExtra : Symbol(withExtra, Decl(contextualTypeWithTuple.ts, 34, 5))
107+
>MyEmptyTuple : Symbol(MyEmptyTuple, Decl(contextualTypeWithTuple.ts, 32, 20))
108+

tests/baselines/reference/contextualTypeWithTuple.types

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,14 @@ let var1: fixed1 = [0, 0]
140140
>0 : 0
141141
>0 : 0
142142

143+
// #52551
144+
type EmptyTuple = []
145+
>EmptyTuple : []
146+
147+
interface MyEmptyTuple extends EmptyTuple { extraInfo?: any; }
148+
>extraInfo : any
149+
150+
const withExtra: MyEmptyTuple = []
151+
>withExtra : MyEmptyTuple
152+
>[] : []
153+

tests/cases/conformance/types/tuple/contextualTypeWithTuple.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ numStrTuple = unionTuple3;
2828
type test1 = [...number[]]
2929
type fixed1 = test1 & { length: 2 }
3030
let var1: fixed1 = [0, 0]
31+
32+
// #52551
33+
type EmptyTuple = []
34+
interface MyEmptyTuple extends EmptyTuple { extraInfo?: any; }
35+
const withExtra: MyEmptyTuple = []

0 commit comments

Comments
 (0)