TypeScript/tests/baselines/reference/assignmentRestElementWithErrorSourceType.types
Anders Hejlsberg d4792062bf
Variadic tuple types (#39094)
* Initial implementation of variadic tuple types

* Accept new baselines

* Handle variadic elements in tuple type inference

* Special case inference between tuples with matching structure

* Restore check that rest element is last element

* Handle variadic tuples in relationship checking

* Accept new baselines

* Infer readonly constraints when inferring from readonly tuples

* Fix lint issues

* T assignable to readonly [...T] and [...T] assignable to T

* Consistent tuple normalization

* Create variadic tuple types from array literal expressions

* Accept new baselines

* Array literals have tuple types when contextual type is readonly

* Accept new baselines

* Optional elements before required elements become required elements

* Update logic for rest parameters and spread arguments

* Revert special case of contextual readonly array type

* Accept new baselines

* Fix lint issue

* Switch entirely to createTupleType based on element flags

* Don't infer readonly tuple types when inferring to variadic elements

* Handle mapped types applied to generic tuple types

* Handle constraint of indexed access type with generic tuple type

* Accept new baselines

* Address CR feedback

* Simplify indexed access types involving generic tuple types

* Propagate checkMode into getSpreadArgumentType

* Guard against missing globalArrayType

* Inference to [...T, ...U] based on implied arity of T

* Accept new baselines

* Add tests

* Emit .d.ts from tests

* Address CR feedback
2020-06-22 18:35:43 -07:00

12 lines
257 B
Plaintext

=== tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts ===
var tuple: [string, number];
>tuple : [string, number]
[...c] = tupel; // intentionally misspelled
>[...c] = tupel : any
>[...c] : any[]
>...c : any
>c : any
>tupel : any