Ayaz Hafiz
b43078440f
Ensure ability-bound variables are registered in their generalization pool
...
When we attempt to bind a type argument to an ability in an alias/opaque
instantiation, we create a fresh flex var to represent satisfaction of
the ability, and then unify the type argument with that flex var.
Previously, we did not register this fresh var in the appropriate rank
pool.
Usually this is not a problem; however, our generalization algorithm is
such that we skip adjusting the rank of redundant variables. Redundant
variables are those that are in the same unification tree, but are not
the root of the unification trees.
This means that if such a flex able var becomes the root of a
unification tree with the type argument, and the type argument is itself
generalized, we will have missed generalization of the argument.
The fix is simple - make sure to register the flex able var into the
appropriate rank pool.
Closes #4408
2022-11-16 17:09:47 -06:00
Ayaz Hafiz
ce160f28a2
Chase under aliases during occurs checking
...
Closes #4368
2022-11-15 16:22:01 -06:00
Folkert de Vries
5e5218fc7e
Merge pull request #4501 from roc-lang/types-soa-variable-opt
...
Emplace variables after converting SoA types, and remove types from constraining
2022-11-15 18:35:56 +01:00
Ayaz Hafiz
b30e8fc9b2
Remove Cells from Types
2022-11-15 09:00:16 -06:00
Folkert de Vries
de472015f6
Merge pull request #4505 from roc-lang/fix-web-repl-palette
...
Fix web REPL error formatting by routing the active Palette everywhere
2022-11-15 15:49:37 +01:00
Ayaz Hafiz
a52e9d605d
Remove unneeded type storage in constraining
2022-11-14 15:15:21 -06:00
Ayaz Hafiz
5564796927
SoA Types get variable emplacement (!)
...
We're now reaching the steady state we want to be closert to - when a
type is translated to a variable, emplace the variable we created for it
in the type index, so that types are never converted again!
2022-11-14 15:15:19 -06:00
Folkert
662bf1de99
more workspace dependencies
2022-11-13 16:10:02 +01:00
Brian Carroll
ed048c7c93
Fix more tests
2022-11-12 09:12:28 +00:00
Ayaz Hafiz
a2e90c3709
Fix types SoA usage in solve
2022-11-11 21:16:23 -06:00
Ayaz Hafiz
6b5f632364
[skip-ci] Fix borrow issues in constraining
2022-11-11 21:16:22 -06:00
Ayaz Hafiz
e3ef9828c7
Store solve aliases as TypeTag
2022-11-11 21:16:05 -06:00
Ayaz Hafiz
e3dbf5c09c
Use capacity when constructing aliases
2022-11-11 21:16:04 -06:00
Ayaz Hafiz
0d642929aa
Remove builtin aliases in favor of alias instantiation optimizations
2022-11-11 21:16:04 -06:00
Ayaz Hafiz
314b75b0e5
Feed SoA Types from load into solve
2022-11-11 21:16:03 -06:00
Ayaz Hafiz
28c3709ddf
Miscellaneous cleanup
2022-11-08 14:11:26 -06:00
Ayaz Hafiz
fb643758bb
Remove Unified BadType
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
09748aec48
Remove problems from error type API surface
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
281bc94b55
Remove FlatType::Erroneous
2022-11-08 14:11:25 -06:00
Ayaz Hafiz
c9953129cb
Remove problem storage in Type::Erroneous
2022-11-08 14:11:24 -06:00
Ayaz
b984351514
Merge pull request #4489 from roc-lang/types-soa-more-in-solve
...
Types SoA for aliases instantiated during solving
2022-11-08 14:06:57 -06:00
Folkert de Vries
95f8bac859
Merge pull request #4485 from roc-lang/types-soa
...
Types SoA and Type -> Variable conversion via SoA
2022-11-08 20:32:27 +01:00
Ayaz Hafiz
7034a4d692
Types SoA for aliases instantiated during solving
2022-11-08 12:57:30 -06:00
Ayaz Hafiz
db8e135a05
Simplify AbilitySet storage
2022-11-08 09:00:25 -06:00
Ayaz Hafiz
191798cfd6
Address clippy
2022-11-08 09:00:25 -06:00
Ayaz Hafiz
b735188542
Life is short, no need to spell it out
2022-11-08 09:00:25 -06:00
Ayaz Hafiz
09ec545995
Fix indent
2022-11-08 09:00:25 -06:00
Ayaz Hafiz
e240b18b27
Recover Erroneous in type
2022-11-08 09:00:25 -06:00
Ayaz Hafiz
58020a55d6
Type to variable through Types SoA
2022-11-08 09:00:24 -06:00
Ayaz Hafiz
dad9a8e537
Pass Types SoA repr in types to Variable translation
2022-11-08 09:00:24 -06:00
Luke Boswell
2c2a70b8e7
Merge remote-tracking branch 'upstream/main' into rust-docs
2022-11-06 09:15:57 +11:00
Folkert
66a1ba00eb
1.65 clippy fixes
2022-11-03 16:20:37 +01:00
Luke Boswell
a3f901427a
correct formatting and removed duplicate image
2022-11-03 20:02:10 +11:00
Luke Boswell
f3bdb5f321
updating rust package documentation
2022-11-03 20:00:06 +11:00
Ayaz Hafiz
3362763e45
Coalesce signature types in value def constraining
2022-11-02 15:05:41 -05:00
Ayaz Hafiz
34cd1fb825
Pattern expectation takes a type index
2022-11-02 15:05:40 -05:00
Ayaz Hafiz
2a4fca7034
First pass at expectations taking a type index
2022-11-02 15:05:22 -05:00
Ayaz Hafiz
6dc6386f77
DefTypes store slices into type indeces
2022-11-02 15:05:01 -05:00
Ayaz Hafiz
99a4e21618
Improve exhaustiveness checking heuristics for list patterns
2022-11-01 12:07:00 -05:00
Ayaz Hafiz
fbdf76e490
Report type errors in list pattern matches
2022-11-01 12:06:59 -05:00
Ayaz Hafiz
5e891a3501
Add comment on when heuristic can be removed
2022-10-31 09:48:25 -05:00
Ayaz Hafiz
9854f5f2ac
Print alias's underlying structures if OIOP vars are material
2022-10-31 09:38:22 -05:00
Ayaz Hafiz
debe6332c5
Support OIOP for type aliases
2022-10-31 09:38:21 -05:00
Ayaz Hafiz
cfe7c8e5ef
Warn on the presence of unnecessary wildcards in output positions
2022-10-31 09:38:20 -05:00
Ayaz Hafiz
bb1f4cd5e8
Fix bug in closing heuristic
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
7b9ce492c3
Better estimate polarity in exhaustiveness checking
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
69114cc820
Apply a heuristic for opening/closing types before exhaustiveness checking
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
f3623b1e47
Close extension types extended wiht uninhabited types after their extension
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
4d48ea7c2f
Materialize extension variable polarity in error type reporting
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
d77080529a
Introduce polarity for extension variable printing
2022-10-31 09:37:39 -05:00