Test: object literal assignments->expanding arrays
Previously, the compiler would run out of memory for more than 13 or 14 of these assignments.
This commit is contained in:
parent
5c2091ad33
commit
1671a06655
56
tests/baselines/reference/assignmentToExpandingArrayType.js
Normal file
56
tests/baselines/reference/assignmentToExpandingArrayType.js
Normal file
|
@ -0,0 +1,56 @@
|
|||
//// [assignmentToExpandingArrayType.ts]
|
||||
// Fixes exponential time/space in #14628
|
||||
let x = []
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' } // previously ran out of memory here
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
|
||||
|
||||
//// [assignmentToExpandingArrayType.js]
|
||||
// Fixes exponential time/space in #14628
|
||||
var x = [];
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' }; // previously ran out of memory here
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
||||
x[0] = { foo: 'hi' };
|
101
tests/baselines/reference/assignmentToExpandingArrayType.symbols
Normal file
101
tests/baselines/reference/assignmentToExpandingArrayType.symbols
Normal file
|
@ -0,0 +1,101 @@
|
|||
=== tests/cases/compiler/assignmentToExpandingArrayType.ts ===
|
||||
// Fixes exponential time/space in #14628
|
||||
let x = []
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 2, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 3, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 4, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 5, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 6, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 7, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 8, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 9, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 10, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 11, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 12, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 13, 8))
|
||||
|
||||
x[0] = { foo: 'hi' } // previously ran out of memory here
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 14, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 15, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 16, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 17, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 18, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 19, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 20, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 21, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 22, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 23, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 24, 8))
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x : Symbol(x, Decl(assignmentToExpandingArrayType.ts, 1, 3))
|
||||
>foo : Symbol(foo, Decl(assignmentToExpandingArrayType.ts, 25, 8))
|
||||
|
222
tests/baselines/reference/assignmentToExpandingArrayType.types
Normal file
222
tests/baselines/reference/assignmentToExpandingArrayType.types
Normal file
|
@ -0,0 +1,222 @@
|
|||
=== tests/cases/compiler/assignmentToExpandingArrayType.ts ===
|
||||
// Fixes exponential time/space in #14628
|
||||
let x = []
|
||||
>x : any[]
|
||||
>[] : undefined[]
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' } // previously ran out of memory here
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
||||
x[0] = { foo: 'hi' }
|
||||
>x[0] = { foo: 'hi' } : { foo: string; }
|
||||
>x[0] : any
|
||||
>x : any[]
|
||||
>0 : 0
|
||||
>{ foo: 'hi' } : { foo: string; }
|
||||
>foo : string
|
||||
>'hi' : "hi"
|
||||
|
27
tests/cases/compiler/assignmentToExpandingArrayType.ts
Normal file
27
tests/cases/compiler/assignmentToExpandingArrayType.ts
Normal file
|
@ -0,0 +1,27 @@
|
|||
// @noImplicitAny: true
|
||||
// Fixes exponential time/space in #14628
|
||||
let x = []
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' } // previously ran out of memory here
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
||||
x[0] = { foo: 'hi' }
|
Loading…
Reference in a new issue