mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-10 15:25:54 -06:00
Add regression test
This commit is contained in:
parent
effa2597fa
commit
42b66066f9
36
tests/baselines/reference/contextualTypeLogicalOr.js
Normal file
36
tests/baselines/reference/contextualTypeLogicalOr.js
Normal file
@ -0,0 +1,36 @@
|
||||
//// [contextualTypeLogicalOr.ts]
|
||||
// Repro from #18005
|
||||
|
||||
let x = 123;
|
||||
var a =
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4];
|
||||
|
||||
|
||||
//// [contextualTypeLogicalOr.js]
|
||||
// Repro from #18005
|
||||
var x = 123;
|
||||
var a = x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4];
|
||||
48
tests/baselines/reference/contextualTypeLogicalOr.symbols
Normal file
48
tests/baselines/reference/contextualTypeLogicalOr.symbols
Normal file
@ -0,0 +1,48 @@
|
||||
=== tests/cases/compiler/contextualTypeLogicalOr.ts ===
|
||||
// Repro from #18005
|
||||
|
||||
let x = 123;
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
var a =
|
||||
>a : Symbol(a, Decl(contextualTypeLogicalOr.ts, 3, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
x && [1, 2, 3, 4];
|
||||
>x : Symbol(x, Decl(contextualTypeLogicalOr.ts, 2, 3))
|
||||
|
||||
139
tests/baselines/reference/contextualTypeLogicalOr.types
Normal file
139
tests/baselines/reference/contextualTypeLogicalOr.types
Normal file
@ -0,0 +1,139 @@
|
||||
=== tests/cases/compiler/contextualTypeLogicalOr.ts ===
|
||||
// Repro from #18005
|
||||
|
||||
let x = 123;
|
||||
>x : number
|
||||
>123 : 123
|
||||
|
||||
var a =
|
||||
>a : number[]
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] || x && [1, 2, 3, 4] : number[]
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4] ||
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
x && [1, 2, 3, 4];
|
||||
>x && [1, 2, 3, 4] : number[]
|
||||
>x : number
|
||||
>[1, 2, 3, 4] : number[]
|
||||
>1 : 1
|
||||
>2 : 2
|
||||
>3 : 3
|
||||
>4 : 4
|
||||
|
||||
17
tests/cases/compiler/contextualTypeLogicalOr.ts
Normal file
17
tests/cases/compiler/contextualTypeLogicalOr.ts
Normal file
@ -0,0 +1,17 @@
|
||||
// Repro from #18005
|
||||
|
||||
let x = 123;
|
||||
var a =
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4] ||
|
||||
x && [1, 2, 3, 4];
|
||||
Loading…
x
Reference in New Issue
Block a user