Commit graph

155 commits

Author SHA1 Message Date
Folkert de Vries
b99d7dba67
Merge pull request #3158 from rtfeldman/parse-expr-defs-soa
Parse expr defs soa
2022-06-15 18:54:30 +02: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
Richard Feldman
f45d1281f7
Merge pull request #3137 from rtfeldman/expect-report
Expect report
2022-06-08 10:13:35 -04:00
Folkert
93e4bff855
renames 2022-06-01 13:11:23 +02:00
Folkert
ad9d06bd63
use Defs in the parse::ast::Expr 2022-06-01 12:54:40 +02:00
Folkert
70df1ff9c7
Merge remote-tracking branch 'origin/trunk' into expect-report 2022-05-26 16:06:34 +02:00
Folkert
2ae804790a
parse toplevel defs into an SOA structure 2022-05-23 22:07:37 +02:00
Richard Feldman
4eec34becf
Update to use new square brace formatting 2022-05-22 23:15:54 -04:00
Ayaz Hafiz
a4c122d5db
Validate derives clauses after solving 2022-05-20 15:56:55 -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 Hafiz
95e325296f
Solve derived impls 2022-05-19 18:23:02 -04:00
Ayaz Hafiz
1beb0551cb
Expose ability names 2022-05-19 18:21:42 -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
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
edee222763 Add AbilityMember can variant for resolving ability specializations 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
Folkert
7be41d8c09
remove unused variables from let/letrec 2022-05-08 20:06:00 +02:00
Folkert
2e9477e011
remove another result wrapper 2022-05-08 17:16:13 +02:00
Folkert
d5b010cb13
remove unused Result wrapper 2022-05-08 17:16:00 +02:00
Ayaz Hafiz
77a1f644a4
Thread error message information for requires 2022-05-06 12:06:27 -04: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
Anton-4
c745c08071
fmt+clippy 2022-05-02 18:33:41 +02:00
Folkert
8fe3e24c8b
step 4: new scope with passing reporting tests 2022-04-30 00:51:32 +02:00
Folkert de Vries
4074088a5e
Merge pull request #2971 from rtfeldman/no-mono-exhaustiveness
No more exhaustiveness checking in mono, nor mono errors
2022-04-29 09:18:50 +02:00
Ayaz Hafiz
9dac9e4bc2 Coalesce 2022-04-28 20:34:03 -04:00
Folkert
99340e314c
remove clone of scope.ident_ids 2022-04-28 23:27:46 +02:00
Folkert
f17cf9d02b
remove var_store argument 2022-04-28 22:30:27 +02:00
Folkert
b1fe5659a4
cleanup 2022-04-28 21:19:27 +02:00
Folkert
992575051a
remove identids from Env 2022-04-28 21:11:08 +02: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
c31b796938
more types! 2022-04-26 20:10:29 +02:00
Ayaz
e736adaa24
Merge pull request #2952 from rtfeldman/ability-unused-method-reporting
Ability unused method reporting
2022-04-25 15:53:06 -04:00
Folkert
945305fc2b
take scope by-value now 2022-04-25 20:50:26 +02:00
Ayaz Hafiz
caf65ba2f8
Fix codegen of effect symbols 2022-04-25 10:59:42 -04:00
Ayaz Hafiz
23bbe0863b
Fix effect module 2022-04-25 10:59:41 -04:00
Folkert
9d17a075d9
halve the number of lookups into References 2022-04-20 20:22:52 +02:00
Folkert
b92c28b237
make calls private 2022-04-20 17:43:18 +02:00
Folkert
c531191e49
make value_lookups private 2022-04-20 17:34:08 +02:00
Folkert
e740bbe529
make some of References' fields private 2022-04-20 17:25:22 +02:00
Folkert
b59d33a1d5
refactor roc_collections 2022-04-19 23:00:05 +02:00
Folkert
7b81c59009
Merge branch 'vecset-references' into builtins-in-roc 2022-04-17 20:32:38 +02:00
Folkert
c47460d792
use VecSet in recursive alias correction 2022-04-17 20:27:47 +02:00
Folkert
304b7fd569
use VecSet for exposed_symbols 2022-04-17 20:23:29 +02:00
Folkert
39aa112fd5
more VecSet 2022-04-17 20:14:25 +02:00