Commit graph

22 commits

Author SHA1 Message Date
Ayaz Hafiz
f21d68c9fb
Consolidate WorldAbilities and solve Phase 2022-06-13 10:40:36 -04:00
Ayaz Hafiz
bf7d57b23f
Import ability lambda sets from other modules during late solving
We're almost there! Just need a way to re-enter already-monomorphized
modules when abilities demand it now.
2022-06-13 08:37:02 -04:00
Ayaz Hafiz
ee6d733cc4
World abilities: big world vs tiny world
Normally a module can see all of its abilities, and any module it
depends on (this is the tiny world, i.e. only the world it is aware of).
But when making specializations, a module may need to see all abilities
in all modules (big world). This patch supports big-world viewing of
abilities.
2022-06-13 08:37:00 -04:00
Ayaz Hafiz
aa9b70a7c8
Distinguish between pending and resolved ability stores
Now that we have unspecialized lambda sets, we need to properly copy
their specialization variables when a module imports another modules'
ability store. I think it will be easier to ensure the correctness if
we distinguish between a "pending" ability store (which may contain
imports whose variables have not been added to subs yet) and "resolved"
abilities stores, which are what we care about for solve and later on.

There is a cost to this since `PendingAbilitiesStore#resolve` destroys
and collects all of the ability member data, rather than in-place
mutating as we did before. However, the resulting `AbilitiesStore` is
now much smaller, so the memory footprint will be better, and also
every field besides `ability_members` will be moved rather than copied.
2022-06-09 12:52:40 -04:00
Ayaz Hafiz
d71fadd8b0
Resolve and compact specialized lambda sets 2022-06-07 08:46:15 -04:00
Ayaz Hafiz
c2a2ce690c
Lift lambda sets as their own type
This prepares for unspecialized lambda set in the type system in
general.
2022-06-01 13:17:22 -05:00
Ayaz Hafiz
4a77ce9eca
<clip> 2022-05-20 17:47:21 -04:00
Ayaz Hafiz
ababfa4129
Use two caches instead of a unified one for obligation checking 2022-05-20 17:39:09 -04:00
Ayaz Hafiz
a4c122d5db
Validate derives clauses after solving 2022-05-20 15:56:55 -04:00
Ayaz Hafiz
768121e431
Don't allocate for missing or existing members by default
- Missing members are zero in the happy case
- Existing members will always be populated in the happy case, but I
  don't think they improve the error message, so just get rid of it.
2022-05-19 18:25:42 -04:00
Ayaz Hafiz
b03e713b7f
Clippy 2022-05-19 18:23:03 -04:00
Ayaz Hafiz
cf56b5015a
Fix existing reporting tests 2022-05-19 18:23:02 -04:00
Ayaz Hafiz
2c87214b44
Check derivability of abilities for structural types 2022-05-19 18:23:02 -04:00
Ayaz Hafiz
312cdd0b70
Correct imports of Encode and abilities across modules 2022-05-19 18:21:40 -04:00
Ayaz Hafiz
da00c47102
Opportunistically resolve specializations during solving 2022-05-11 08:53:15 -04:00
Ayaz Hafiz
025d501cfd Determine ability specializations before walking a body 2022-05-08 15:08:17 -04:00
Ayaz Hafiz
c1b1f60630 Coupon cutting 2022-05-08 15:08:16 -04:00
Ayaz Hafiz
b5efd830e5 Solve and gen ability members that bind other able variables 2022-05-08 15:07:27 -04:00
Ayaz Hafiz
7d4a006377
Bugfix sorting must implement constraints
Also makes things go faster
2022-04-15 09:29:12 -04:00
Ayaz Hafiz
8f335c3278
Add solve test for aliasing ability 2022-04-14 17:25:44 -04:00
Ayaz Hafiz
b79b351136
The first ability... compiles 2022-04-14 16:50:41 -04:00
Ayaz Hafiz
8eec930260
More and smarter checking and error reporting for abilities 2022-04-13 15:25:19 -04:00