Commit graph

265 commits

Author SHA1 Message Date
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
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
312cdd0b70
Correct imports of Encode and abilities across modules 2022-05-19 18:21:40 -04:00
Folkert
69e7d0a378
use opt var in cycle marks 2022-05-15 13:14:18 +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
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
Ayaz Hafiz
5cc6727e9f Simplify introduced variables in ability member 2022-05-08 15:08:19 -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
Folkert
7be41d8c09
remove unused variables from let/letrec 2022-05-08 20:06:00 +02:00
Folkert
d5b010cb13
remove unused Result wrapper 2022-05-08 17:16:00 +02:00
Folkert
c5b7ff98fd
move reference matrix 2022-05-08 12:18:10 +02:00
Folkert
8a209334cc
use bitvec in the input for sccs 2022-05-07 00:39:15 +02:00
Ayaz Hafiz
e8fbda44fc
Revert "Revert "Thread through symbols_from_requires""
This reverts commit 8ac1dfac1a.
2022-05-06 12:06:27 -04:00
Richard Feldman
8ac1dfac1a
Revert "Thread through symbols_from_requires"
This reverts commit 1421aebcd3.
2022-05-05 16:19:34 -04:00
Richard Feldman
1421aebcd3
Thread through symbols_from_requires 2022-05-05 16:18:47 -04:00
Richard Feldman
e6a72578c1
Add Annotation::add_to 2022-05-05 16:17:49 -04:00
Ayaz
84b3ef5fd7
Merge pull request #2978 from rtfeldman/scope-bitmask
Scope bitmask
2022-05-01 12:26:14 -04:00
Folkert
6fb014baba
more cleanup 2022-04-30 01:25:27 +02:00
Folkert
953369e0d8
cleanup 2022-04-30 00:57:21 +02:00
Folkert
8fe3e24c8b
step 4: new scope with passing reporting tests 2022-04-30 00:51:32 +02:00
Ayaz Hafiz
83c6c3a17d
Remove Lowercase from Alias and Opaque 2022-04-29 11:36:31 -04:00
Ayaz Hafiz
9dac9e4bc2 Coalesce 2022-04-28 20:34:03 -04:00
Folkert
7fb5b23fb0
move identids into Scope 2022-04-28 21:08:28 +02:00
Folkert
fb9d60226d
store `exposed_ident_ids in the scope itself 2022-04-28 20:30:02 +02:00
Folkert
5a613db7b6
use snapshots for inner scopes 2022-04-28 20:01:01 +02:00
Folkert
1372825ebb
refactor 2022-04-27 20:53:00 +02:00
Folkert
08c8968236
use interner in Scope + fix shadowing being reported incorrectly 2022-04-27 20:40:58 +02:00
Folkert
09fbd4a505
fix typo 2022-04-27 20:22:52 +02:00
Folkert
34d77cffdb
Merge branch 'refactor-closure-can' into scope-smarter-storage 2022-04-27 19:46:02 +02:00
Folkert
b265663515
reduce allocations in pattern iteration 2022-04-27 18:44:06 +02:00
Folkert
984ef53e75
shaving off a couple more lines 2022-04-27 17:29:32 +02:00
Folkert
2973af5f79
get rid of env.closure_name_symbol 2022-04-27 17:11:33 +02:00
Folkert
465fad9da1
refactor it all again 2022-04-27 17:01:18 +02:00
Folkert
6783b66db7
stop using env.closures 2022-04-27 16:44:29 +02:00
Folkert
c28a0af932
refactor: special-case the canonicalization of a Closure def 2022-04-27 16:42:04 +02:00
Folkert
c31b796938
more types! 2022-04-26 20:10:29 +02:00
Folkert
4164dcc3da
more debug info 2022-04-26 09:14:29 +02:00
Folkert
a26fa4559a
prevent intermediate allocation 2022-04-25 21:02:45 +02:00
Folkert
945305fc2b
take scope by-value now 2022-04-25 20:50:26 +02:00
Folkert
a0d688bfb7
stop reporting unused ability members 2022-04-25 20:45:54 +02:00
Folkert
f7c110dbc1
comments + renames 2022-04-25 16:34:47 +02:00
Folkert
3ec3976781
fix issue with wrong alias being used for instantiation 2022-04-24 22:08:11 +02:00