Commit graph

218 commits

Author SHA1 Message Date
Folkert
9f7c7b56a1
use ReferenceMatrix in DefOrdering 2022-04-22 15:49:32 +02:00
Folkert
0c10fa31f5
rename 2022-04-22 15:41:21 +02:00
Folkert
e40e4ae846
rename 2022-04-22 15:17:43 +02:00
Folkert
8837eb2c19
remove old def sorting code 2022-04-22 15:09:45 +02:00
Folkert
c763d51551
use new sccs in error case too 2022-04-22 15:04:16 +02:00
Folkert
887acb7519
be smarter about when a function is recursive 2022-04-22 14:41:42 +02:00
Folkert
8c08c63151
faster strongly-connected components 2022-04-22 14:10:46 +02:00
Folkert
45567a591c
rename 2022-04-22 13:42:57 +02:00
Folkert
141f88365d
use extra bitvec to spot faulty recursion 2022-04-22 12:56:50 +02:00
Folkert
b6ccd9c8fb
use bitvec-based topological sort 2022-04-22 11:35:08 +02:00
Folkert de Vries
2cc8e95198
Merge pull request #2901 from rtfeldman/vec-map
VecMap
2022-04-21 09:16:38 +02:00
Ayaz Hafiz
4bbc1d3a2b
Clippy 2022-04-20 17:46:19 -04:00
Ayaz Hafiz
b9f79fdd31
Able variables through different functions compile 2022-04-20 17:43:17 -04:00
Ayaz Hafiz
a07323fb40
Typecheck annotations with able variables outside ability members 2022-04-20 17:43:16 -04:00
Folkert
e87ca7e4b7
create and union fewer Output's 2022-04-20 21:20:59 +02:00
Folkert
9d17a075d9
halve the number of lookups into References 2022-04-20 20:22:52 +02:00
Folkert
ec43d7d770
clippy 2022-04-20 18:05:06 +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
8b144c446d
remove PartialEq for a bunch of types that we should not compare 2022-04-20 16:58:30 +02:00
Folkert
b59d33a1d5
refactor roc_collections 2022-04-19 23:00:05 +02:00
Ayaz Hafiz
f129777115
Explicitly disallow ability definitions in nested scopes
Abilities can only be defined on the toplevel of a module. There is a
technical reason to this, which is that during type solving we must
introduce all abilities at the very beginning, and we need to make sure
ranks are correct. But there is a practical reason as well, which is
that nested ability definitions don't seem to be very useful.

Note that specializations can be nested, and are allowed to be. Also, we
can revisit this in the future. I just don't want experiments to break
right now because someone uses an ability in a nested scope where we
don't expect.

Closes #2878
2022-04-18 18:04:46 -04:00
Folkert
7f3ca4458a
use VecSet in IntroducedVariables 2022-04-17 20:50:41 +02:00
Folkert
dda4f46e67
use VecSet in References 2022-04-17 19:37:10 +02:00
Ayaz Hafiz
6b4294307f
Start saving ability signature on designated variable again 2022-04-14 16:22:54 -04:00
Ayaz Hafiz
0792ccbbe8
Calling ability with non-specialized type is an error 2022-04-13 11:49:33 -04:00
Ayaz Hafiz
d110fbde6c
Annotation specializes ability 2022-04-13 10:44:34 -04:00
Ayaz Hafiz
25b3aa7ca7
Typed body specializations solve 2022-04-13 10:42:46 -04:00
Ayaz Hafiz
389c46edcf
Remove unneeded var 2022-04-13 10:12:45 -04:00
Ayaz Hafiz
5e1ab8225e
Report when ability member binds >1 variable to parent 2022-04-13 10:11:24 -04:00
Ayaz Hafiz
cbbbb8c855
Remove stray dbgs 2022-04-12 16:32:50 -04:00
Ayaz Hafiz
15a040ec87
Basic type inference and solving for abilities
Note that is still pretty limited. We only permit opaque types to
implement abilities, abilities cannot have type arguments, and also no
other functions may depend on abilities
2022-04-12 16:18:07 -04:00
ayazhafiz
94a5cd3559 Improve shadow errors 2022-04-07 22:38:20 -04:00
Ayaz Hafiz
73bfff699f Handle symbols that shadow ability member definitions
Just add the shadowing symbol for now. We'll handle checking that a
specialization's type matches the member's type definition in a later
pass, during typechecking.
2022-04-07 17:21:17 -04:00
Ayaz Hafiz
66ec1b4a84 Basic canonicalization and error checking for abilities 2022-04-07 17:21:17 -04:00
Ayaz Hafiz
d3b848fa46
Clippy 2022-04-06 22:24:14 -04:00
Ayaz Hafiz
a3ac68a41f
Split up Defs into TypeDef and ValueDef
Just a refactoring PR. This is useful because during canonicalization
we always process type defs first, then value defs. With abilities this
distinction continues to grow; in that case, we have patterns associated
with types that we want to process before patterns from values.
2022-04-06 22:18:57 -04:00
Folkert
0dd2cec09a
update with new clippy lints 2022-03-31 19:34:51 +02:00
Folkert
7029717cd0
fix missing import 2022-03-21 23:46:25 +01:00
Folkert
725eb217d8
more vecs, less sets 2022-03-21 23:20:57 +01:00
Folkert
14b53c0ccf
simplify local_successors 2022-03-21 23:16:07 +01:00
Folkert
cee1a787c9
and remove everything because it has no effect 2022-03-21 23:07:27 +01:00
Folkert
1b1a7b0385
more cleaned up 2022-03-21 22:54:24 +01:00
Folkert
a170f461e0
cleanup 2022-03-21 22:44:14 +01:00
Folkert
cc9873eb6d
exploration 2022-03-21 22:41:32 +01:00
hafiz
3f07afe3b5
Merge pull request #2750 from rtfeldman/delay-instantiating-aliases-fix-limitations
Delay instantiating aliases fix limitations
2022-03-19 20:41:14 -04:00
Folkert
4e315797b0
expose ImMap entry 2022-03-19 00:00:56 +01:00
Folkert
9b63e6a3a9
simplify IntroducedVariables 2022-03-18 23:47:39 +01:00
Folkert
d6f0005fb3
bubble up lambda sets used by inner aliases 2022-03-18 20:04:07 +01:00