Commit graph

63 commits

Author SHA1 Message Date
Folkert
572bd66fb7
remove exosed_ident_ids 2022-04-28 21:34:58 +02:00
Folkert
7fb5b23fb0
move identids into Scope 2022-04-28 21:08:28 +02:00
Folkert
37cb9279f5
prepare for all_ident_ids 2022-04-28 20:42:00 +02:00
Folkert
65e534b2b1
rename 2022-04-28 20:34:55 +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
70844b1218
add snapshot functionality 2022-04-28 19:49:44 +02:00
Folkert
2844be4383
move IdentStore to the bottom 2022-04-27 21:03:18 +02:00
Folkert
d09036bb4f
don't have shadowing overwrite our data 2022-04-27 20:59:40 +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
7af2bb343c
remove unused Scope functions 2022-04-27 19:53:30 +02:00
Folkert
34d77cffdb
Merge branch 'refactor-closure-can' into scope-smarter-storage 2022-04-27 19:46:02 +02:00
Folkert
622c6f3248
Merge remote-tracking branch 'origin/trunk' into scope-smarter-storage 2022-04-27 19:45:09 +02:00
Folkert
2d0a9c8531
stop scope diffing in when canonicalization 2022-04-27 17:57:42 +02:00
Folkert
d3ef35d935
rename 2022-04-26 11:33:26 +02:00
Folkert
af6c3231f3
Improved IdentIds 2022-04-25 23:15:57 +02:00
Folkert
6028507dff
Merge remote-tracking branch 'origin/trunk' into scope-smarter-storage 2022-04-25 21:33:20 +02:00
Ayaz Hafiz
f1dc9c8298
Opaques take @ : %s/\$\([A-Z]\)/@\1/g 2022-04-25 12:26:38 -04:00
Ayaz Hafiz
b6383f81ee
Numbers are opaques 2022-04-25 10:59:42 -04:00
Folkert
7b234911ac
do the work 2022-04-22 23:47:43 +02:00
Folkert
894e5bdd5c
add code for more efficient identifier store 2022-04-22 22:06:00 +02:00
Folkert
8720462839
use more specific function to get symbols/regions 2022-04-22 21:41:17 +02:00
Folkert
6ffe14809f
don't populate Scope with aliases
these are now properly imported. For testing reporting we still need a way
to provide them without resolving imports (just for speed)
2022-04-22 20:49:46 +02:00
Folkert
e112f6ad2c
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-04-16 21:01:51 +02: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
Folkert
6ef443d1b0
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-04-10 19:14:00 +02:00
Ayaz Hafiz
1ca3dad1e2 Allow complicated return type 2022-04-07 17:21:17 -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
Folkert
7b221d6115
Merge branch 'simplify-identids' into builtins-in-roc 2022-03-22 22:25:55 +01:00
Folkert
a67bb29a36
remove hashmap 2022-03-22 21:58:49 +01:00
Folkert
bf063d1d57
use all aliases that are in scope (to support imported aliases) 2022-03-18 20:44:13 +01:00
Folkert
bd31503855
Merge remote-tracking branch 'origin/trunk' into builtins-in-roc 2022-02-28 18:55:20 +01:00
ayazhafiz
86aa0df661 Add constraint generation for opaque types 2022-02-27 00:10:11 -05:00
Folkert
c0d3543d5a
make Str + Result work 2022-02-26 17:52:24 +01:00
ayazhafiz
e420ebd023 Add TODOs for opaque type comments that will need to be changed later 2022-02-21 23:21:39 -05:00
ayazhafiz
90de82e295 Validation of opaques during canonicalization 2022-02-21 18:25:19 -05:00
ayazhafiz
6b53692aac Canonicalize opaque types 2022-02-20 13:47:01 -05:00
ayazhafiz
ac680d0750 Aliases should not be public 2022-02-12 21:23:44 -05:00
ayazhafiz
8c0e39211d Instantiate recursive aliases to their smallest closures
Now, when we have two aliases like

```
T a : [ A, B (U a) ]
U a : [ C, D (T a) ]
```

during the first pass, we simply canonicalize them but add neither to
the scope. This means that `T` will not be instantiated in the
definition of `U`. Only in the second pass, during correction, do we
instantiate both aliases **independently**:

```
T a : [ A, B [ C, D (T a) ] ]
U a : [ C, D [ A, B (U a) ] ]
```

and now we can mark each recursive, individually:

```
T a : [ A, B [ C, D <rec1> ] ] as <rec1>
U a : [ C, D [ A, B <rec2> ] ] as <rec2>
```

This means that the surface types shown to users might be a bit larger,
but it has the benefit that everything needed to understand a layout of
a type in later passes is stored on the type directly, and we don't need
to keep alias mappings.

Since we sort by connected components, this should be complete.

Closes #2458
2022-02-11 08:43:33 -05:00
ayazhafiz
0eede1cd86 Generate unique symbols for shadowing identifiers
This code has a shadowing error:

```
b = False
f = \b -> b
f b
```

but prior to this commit, the compiler would hit an internal error
during monomorphization and not even get to report the error. The reason
was that when we entered the closure `\b -> b`, we would try to
introduce the identifier `b` to the scope, see that it shadows an
existing identifier, and not insert the identifier. But this meant that
when checking the body of `\b -> b`, we would think that we captured the
value `b` in the outer scope, but that's incorrect!

The present patch fixes the issue by generating new symbols for
shadowing identifiers, so deeper scopes pick up the correct reference.
This also means in the future we may be able to compile and execute code
with shadows, even though it will still be an error.

Closes #2343
2022-01-23 12:35:31 -05:00
Joshua Warner
f19220473a Rename Located -> Loc 2021-12-22 19:18:22 -08:00
Brendan Hansknecht
d49ac68bcc Update dep with major version changes 2021-11-05 19:19:37 -07:00
Anton-4
f63c276a5f docs flow working with mocked markup to html 2021-10-01 18:22:27 +02:00
Folkert
df83bf0d48 Merge remote-tracking branch 'origin/soa-alias' into alias-nominal-equality 2021-08-13 12:11:36 +02:00
Folkert
ceb5cc66fa use IdentStr 2021-08-03 21:14:36 +02:00
Folkert
13b05e54e8 Merge remote-tracking branch 'origin/clippy-1.54' into alias-nominal-equality 2021-07-30 14:25:50 +02:00
Folkert
899cbeabd7 fix extra ampersands 2021-07-29 17:32:08 +02:00