Ayaz
61dd5cc8c7
Merge pull request #5179 from roc-lang/i5143-tuple-abilities
...
Implement ability obligation checking and derivation for tuples
2023-03-25 15:51:39 -05:00
Ayaz Hafiz
3e83e42195
Make sure to report error rather than descending as appropriate
2023-03-22 17:08:43 -05:00
Ayaz Hafiz
3d2642b282
Stray dbg
2023-03-22 17:08:42 -05:00
Ayaz Hafiz
e6094df69b
Fast-path for determining ability member impls for builtin opaques
2023-03-22 17:08:41 -05:00
Ayaz Hafiz
dba72c0565
Handle builtin opaque types that implement an ability but don't explicitly list so
2023-03-22 17:03:35 -05:00
Ayaz Hafiz
f4f9ae7a5d
Implement obligation checking of tuples for all abilities
2023-03-22 10:03:01 -05:00
Ayaz Hafiz
63e30443fd
Fix formatting
2023-01-27 17:35:31 -06:00
Ayaz Hafiz
572a666780
No Encode/Decode for Nat
2023-01-27 17:16:10 -06:00
Joshua Warner
de828416bf
Initial implementation of tuples in type checking
...
This leaves in place a bunch of TODOs and likely many bugs - notably, I haven't tested codegen/layout at all here.
2023-01-22 12:40:44 -08:00
Ayaz Hafiz
1c93727822
Add a notion of "openness" tag extensions suitable only for size-polymorphism
2023-01-16 10:52:23 -06:00
Ayaz Hafiz
4159b83214
Fix imports
2022-12-03 13:17:35 -08:00
Ayaz Hafiz
2e56405c1e
Fix obligation checking for rigid able vars
2022-12-03 13:17:34 -08:00
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
a2e90c3709
Fix types SoA usage in solve
2022-11-11 21:16:23 -06:00
Ayaz Hafiz
314b75b0e5
Feed SoA Types from load into solve
2022-11-11 21:16:03 -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
Folkert
66a1ba00eb
1.65 clippy fixes
2022-11-03 16:20:37 +01:00
Ayaz Hafiz
4d48ea7c2f
Materialize extension variable polarity in error type reporting
2022-10-31 09:37:40 -05:00
Ayaz Hafiz
0da72df5e9
Add ability slice to eq obligation checker
2022-10-24 14:00:46 -05:00
Ayaz Hafiz
9c88534758
Obligation checking layers on extra abilities bound to a variable
2022-10-24 13:59:52 -05:00
Ayaz Hafiz
229548571b
Represent "able" variables with slices of abilities
2022-10-24 13:59:51 -05:00
Ayaz Hafiz
e75f3c3c79
Get rid of MemberImpl::Derived
...
We don't need this anymore, since derived members become Impls during
canonicalization now!
2022-10-23 20:48:07 -05:00
Ayaz Hafiz
20e4295eea
Make sure type variables bound to abilities are instantiated in aliases
...
Closes #4259
2022-10-14 13:56:00 -05:00
Ayaz Hafiz
6149c289fc
Update Eq symbols
2022-10-12 16:38:36 -05:00
Ayaz Hafiz
12778762b2
Make sure Box
is handled as an Apply
type
2022-10-12 16:37:50 -05:00
Ayaz Hafiz
b587bcf0c2
Implement obligation checking for the Eq
ability
...
Every type can have `Eq.isEq` derived for it, as long as
- it does not transitively contain a function
- it does not transitively contain a floating point value
- it does not transitively contain an opaque type that does not support
`Eq`
2022-10-12 16:37:49 -05:00
Ayaz Hafiz
e9efc95425
Obligation checking for the Hash
ability
...
This implements type-level checks that types can and cannot implement
the `Hash` ability.
Part of #4195
2022-10-04 10:51:14 -05:00
Ayaz Hafiz
a1d8f8392a
Include RigidOptional as optional field
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
e77e53f37b
Enable optional record field underivable error
2022-08-23 10:39:51 -05:00
Ayaz Hafiz
55fe1df995
Add more context to derivability errors when they happen
2022-08-23 10:39:50 -05:00
Ayaz Hafiz
d2b9cc056f
Record with optionally-typed fields cannot be derived for decoding
2022-08-23 10:38:30 -05:00
Ayaz Hafiz
6255332cee
Promote flex vars to flex-able in obligation checking
2022-08-22 17:05:56 -05:00
Ayaz Hafiz
60ed17155c
Check in gen test for record decoding!
2022-08-15 11:11:36 -05:00
Ayaz Hafiz
b62c9d1faa
Support specialization of ability members that don't decay to functions
2022-08-03 10:16:22 -05:00
Ayaz Hafiz
fb5ab7d7ca
More aggressive inlining
2022-08-02 14:31:17 -05:00
Ayaz Hafiz
19e93962cb
Check for builtin opaque types that always have a derived impl
2022-08-02 14:31:17 -05:00
Ayaz Hafiz
4bbc6b74fc
Add derivability obligation checking for Decode
2022-08-02 14:31:16 -05:00
Ayaz Hafiz
a7bc8cf4f2
Switch obligation checking to use a visitor
...
My hope is this will make obligation checking for other abilities easier
to add when we do so
2022-08-02 14:30:10 -05:00
Ayaz Hafiz
b8328c2b5b
Remove stray dbgs
2022-08-01 09:09:37 -05:00
Ayaz Hafiz
2adde2351f
Add subs to member_parent_and_signature_var
2022-08-01 09:05:16 -05:00
Ayaz Hafiz
b72c8705e5
Add an AbilityResolver trait for abilities stores and views
2022-08-01 08:09:24 -05:00
Ayaz Hafiz
c0e976f544
Wrap unification subs in Env
2022-07-28 08:57:33 -04:00
Ayaz Hafiz
0989b2cb82
Move solve problems to their own crate
2022-07-28 08:57:32 -04:00
Ayaz Hafiz
ae4916ceb7
Remove unused variables
2022-07-28 08:57:14 -04:00
Ayaz Hafiz
753d12e912
Eagerly resolve obligations during solving
...
Replaces the previously-used `DeferredObligations` structure used for
accumulating and then acting over ability obligations during module
solving in favor of just the `ObligationCache`. The `ObligationCache`
stays alive for the entirety of a module solving and provides a
convenient mechanism for answering obligation queries with a backed
cache.
2022-07-28 08:57:13 -04:00
Ayaz Hafiz
bb14b649a2
Don't re-report obligations that we know were seen elsewhere
2022-07-26 20:46:35 -04:00
Ayaz Hafiz
6b9c1cb690
Check whether opaque implements ability using store
2022-07-26 20:46:35 -04:00