Ayaz Hafiz
ed7d4f8f63
Obligation checking of floating point for Eq succeeds only with Dec
2022-12-01 11:31:41 -06:00
Ayaz Hafiz
590535a42b
Obligation checking Eq for floating point types may never succeed
2022-12-01 10:02:37 -06:00
Ayaz Hafiz
7c3a0807c2
Suggest binding type variables to an ability when they're unsatisfied
2022-11-23 16:37:50 -06:00
Ayaz Hafiz
c70b23ac9c
Debug Work
2022-11-22 13:04:27 -06:00
Ayaz
1a3119e4c5
Merge pull request #4525 from roc-lang/fix-fixpoints-2
...
Implement fixpoint-fixing and unconditionally emplace variables into type indices
2022-11-19 17:47:02 -06:00
Ayaz
a74d7e14b7
Merge branch 'main' into i4416
...
Signed-off-by: Ayaz <20735482+ayazhafiz@users.noreply.github.com>
2022-11-17 09:07:00 -06:00
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
f7bc3148ae
Address lints
2022-11-16 14:05:53 -06:00
Ayaz Hafiz
0a9a20a53c
Correct emplace variables in type indices during translation
...
Prior to this commit, we emplace type variables into `Index<TypeTag>`
only for translated top-level types. However, we need to be careful to
do this emplacement for nested types as well! This patch ensures we do,
but immediately emplacing the destination variable of a type when we
allocate a variable for it.
2022-11-16 14:05:52 -06:00
Ayaz Hafiz
3305041316
Add Debug derives in lambda set compaction
2022-11-16 13:55:15 -06:00
Ayaz Hafiz
b30e8fc9b2
Remove Cells from Types
2022-11-15 09:00:16 -06: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
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
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
debe6332c5
Support OIOP for type aliases
2022-10-31 09:38:21 -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
4d48ea7c2f
Materialize extension variable polarity in error type reporting
2022-10-31 09:37:40 -05:00
Folkert de Vries
02a76bb8bd
Merge pull request #4399 from roc-lang/no-types-in-constraining-api
...
Have most constraining APIs take a type index rather than `Type`
2022-10-26 19:45:55 +02:00