Richard Feldman
66bcb53eb1
Merge pull request #3108 from rtfeldman/check-derived2
...
Validate derives clauses after solving
2022-05-21 11:39:18 -04:00
Richard Feldman
ba2465989a
Merge pull request #3098 from rtfeldman/check-derived
...
Canonicalize "has"-deriving clauses
2022-05-21 11:38:59 -04:00
Richard Feldman
49aea9d639
Use [u8; 16] to avoid number alignment bumps
2022-05-21 00:53:47 -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
4cf87510c8
Cleanup abilities_in_scope
and rename to pending_abilities_in_scope
...
`abilities_in_scope` is a buffer we use to keep track of locally-defined
abilities before we've fully resolved them. We do this because we
canonicalize ability members signatures before we've registered an
ability to the abilities store, and canonicalization of signatures must
report `has` bounds that don't reference abilities.
So, this buffer is more appropriately named `pending_abilities_in_scope`.
There is also no reason to export it, because it is only relevant
during canonicalization of type defs in a module.
2022-05-20 15:56:55 -04:00
Ayaz Hafiz
9712cfe342
Canonicalize deriving
2022-05-20 15:55:45 -04:00
Ayaz Hafiz
22bf650685
Cleanup abilities_in_scope
and rename to pending_abilities_in_scope
...
`abilities_in_scope` is a buffer we use to keep track of locally-defined
abilities before we've fully resolved them. We do this because we
canonicalize ability members signatures before we've registered an
ability to the abilities store, and canonicalization of signatures must
report `has` bounds that don't reference abilities.
So, this buffer is more appropriately named `pending_abilities_in_scope`.
There is also no reason to export it, because it is only relevant
during canonicalization of type defs in a module.
2022-05-20 09:57:31 -04:00
Ayaz
8c358332c8
Merge pull request #3093 from rtfeldman/derivable-abilities
...
Typecheck deriving of abilities for types
2022-05-19 21:18:04 -04:00
Ayaz
e5eb9c9f1c
Merge pull request #3052 from rtfeldman/build-encode
...
Encode/JSON in standard library typechecks
2022-05-19 21:16:59 -04:00
Ayaz Hafiz
c7dacb879c
Ignore derived for now
2022-05-19 18:29:31 -04:00
Ayaz Hafiz
95e325296f
Solve derived impls
2022-05-19 18:23:02 -04:00
Ayaz Hafiz
6d19f31574
Remove mono-related changes for now
2022-05-19 18:21:43 -04:00
Ayaz Hafiz
1beb0551cb
Expose ability names
2022-05-19 18:21:42 -04:00
Ayaz Hafiz
f1e09fbe78
Pass ability specializations back down
2022-05-19 18:21:41 -04:00
Ayaz Hafiz
0f4be93e44
Add JSON builtin, pass along solved specializations per module
2022-05-19 18:21:40 -04:00
Ayaz Hafiz
312cdd0b70
Correct imports of Encode and abilities across modules
2022-05-19 18:21:40 -04:00
Folkert
f285e7ce93
add a TypedHole node to Expr, for use in the editor
2022-05-18 16:39:24 +02:00
Folkert
95bf8bb505
scope.lookup_str
2022-05-17 20:48:20 +02:00
Drake
c4ab5a02eb
fix: cargo fmt
2022-05-14 15:46:57 -06:00
Drake
43674efb32
fix: pass along parsed number string
2022-05-14 15:44:16 -06:00
Folkert
69e7d0a378
use opt var in cycle marks
2022-05-15 13:14:18 +02:00
Folkert
7face320eb
move back to one loc_symbols vector
2022-05-14 14:44:37 +02:00
Ayaz Hafiz
710a10a29c
Check for invalid cycles after type solving recursive defs
...
Disallow cycles that pass through a non-function value. Since we
evaluate eagerly, having one such cycle means there is at least one path
in the program that (likely) has unbounded recursion. Of course we can't
be certain (halting problem), but it's very likely, and avoids stuff
like #1926 . Also, mono (as it's done today) won't work if things in a
cycle aren't functions.
Closes #1926
2022-05-11 14:57:01 -04:00
Ayaz Hafiz
17d8545510
Remove symbols_from_pattern
2022-05-11 14:53:40 -04:00
Ayaz Hafiz
9777886376
Fill out pattern traversals, add symbol discovery
2022-05-11 14:53:39 -04:00
Ayaz Hafiz
eca069bb4a
Test static specializations
2022-05-11 08:53:41 -04:00
Ayaz Hafiz
da00c47102
Opportunistically resolve specializations during solving
2022-05-11 08:53:15 -04:00
Ayaz Hafiz
619d9aa8b3
Decrease specialization ID size
2022-05-11 08:52:49 -04:00
Ayaz Hafiz
bdccda6cfb
Add some debug-assertions regarding what we know about specializations
2022-05-11 08:52:48 -04:00
Ayaz Hafiz
b0734c3d80
Disallow abilities on toplevel of scope
2022-05-09 09:45:02 -04:00
Richard Feldman
df7df4ccf8
Merge branch 'trunk' into mfonism/rename-num-float-type-to-frac
2022-05-08 20:54:33 -04:00
ayazhafiz
f2d3865315
Fix can AST walk
2022-05-08 15:17:59 -04:00
Ayaz Hafiz
4bfbe479c9
Useless comment
2022-05-08 15:08:20 -04:00
Ayaz Hafiz
798c28fccd
Dryasdust was a popular word in 1860
2022-05-08 15:08:20 -04:00
Ayaz Hafiz
da604e978e
Use SpecializationId to mark specializations
2022-05-08 15:08:19 -04:00
Ayaz
4858979d6b
Remove stale comment
2022-05-08 15:08:19 -04:00
Ayaz Hafiz
08beedb648
Improve codelink comment
2022-05-08 15:08:19 -04:00
Ayaz Hafiz
5cc6727e9f
Simplify introduced variables in ability member
2022-05-08 15:08:19 -04:00
Ayaz Hafiz
025d501cfd
Determine ability specializations before walking a body
2022-05-08 15:08:17 -04:00
Ayaz Hafiz
edee222763
Add AbilityMember can variant for resolving ability specializations
2022-05-08 15:08:16 -04:00
Ayaz Hafiz
ebbcd57022
Make visitors public
2022-05-08 15:08:16 -04:00
Ayaz Hafiz
d2eb5e17ec
Fill out can traversals
2022-05-08 15:08:16 -04:00
Ayaz Hafiz
c1b1f60630
Coupon cutting
2022-05-08 15:08:16 -04:00
Ayaz Hafiz
2e57bf0b6a
Permit able variables in aliases, and thread them through
2022-05-08 15:08:14 -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
c01baa9168
Fix failing reporting tests
2022-05-08 15:07:27 -04:00
Folkert
7be41d8c09
remove unused variables from let/letrec
2022-05-08 20:06:00 +02:00
Mfon Eti-mfon
9068c2414e
Rename float functions and vars
2022-05-08 18:42:12 +01:00
Folkert
2e9477e011
remove another result wrapper
2022-05-08 17:16:13 +02:00