Skip to content

As a developer I want array literals to be typed as ArrayN<...> instead of just Array<union{...}> #2612

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mmews-n4 opened this issue Mar 12, 2024 · 0 comments · Fixed by #2613
Assignees

Comments

@mmews-n4
Copy link

The following example shows a type cast to ArrayN which should be obsolete:

let arr1 :Array2<number, string> = [42, 'hello'];
let [a, b] = arr1; // a typed as number, b typed as string
@mmews-n4 mmews-n4 self-assigned this Mar 12, 2024
mmews-n4 pushed a commit that referenced this issue Apr 18, 2024
…..> instead of just Array<union{...}> (#2613)

* add test

* first shot

* adjust tests

* add helper method

* support type inference on indexed access

* adjust test

* tweaks for ArrayN inference

* adjust tests

* next try, added tests

* next try

* adjust tests

* adjust tests

* reducer respects structural subtype check wrt. optional properties

* improved error message in case of failed poly processor

* remove obsolete casts

* adjust tests

* adjust tests

* improve nested object literals, improve non-backtracker wrt. struct. obj

* adjust tests

* fix concurrent exception

* fix hover exception

* add some tests, some src improvements

* more tests, adjust tests

* fix several issues: Deadlock during startup, Text Highlight and
Documentation, Issue creation

* adjust built-ins Array#concat to support unification of types

* add tests

* adjust tests

* more tests / corner cases

* add test, adjust tests

* support parentheses around return expressions

* adjusted tests

* several unrelated changes

* many improvements, performance, reduce unions with match, ...

* add another test for bug regarding union of methods with type vars

* enhance deadlock bugfix

* fix handling type vars of composed methods

* adjust some test expectations

* fix double reporting, adjust tests, add test case

* fix/mitigate hover bug

* postpone to GH-2615

* incorporate review changes

* bump minor version due to backwards incompatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant