Ayaz Hafiz
f3ddc254c1
Update comment
2023-03-25 16:14:21 -05:00
Ayaz Hafiz
ecad660e7f
Ensure that when jumping to a branch, all pattern symbols are loaded
...
If we are jumping to a target branch, it is necessary that the target
branch has all required pattern symbols loaded in it. Usually this is
already the case, but there is an exception with guarded patterns.
Guarded patterns have their patterns loaded only right before the guard
is evaluated, which happens at some point further along the decision
tree. As such, when a guarded pattern jumps to its target destination,
it should append the loaded patterns as parameters on the target
joinpoint.
2023-03-25 16:14:21 -05:00
Ayaz Hafiz
393250db92
Utility to collect symbols bound by a pattern
2023-03-25 16:14:21 -05:00
Ayaz Hafiz
fe9be63787
Utility to substitute many symbols at once
2023-03-25 16:14:20 -05:00
Ayaz
1891df77b8
Merge pull request #5188 from roc-lang/i5177
...
Make sure openness constraint goes under tuples
2023-03-25 15:52:09 -05:00
Ayaz
61dd5cc8c7
Merge pull request #5179 from roc-lang/i5143-tuple-abilities
...
Implement ability obligation checking and derivation for tuples
2023-03-25 15:51:39 -05:00
Ayaz Hafiz
1b2ee9ad30
Make sure openness constraint goes under tuples
...
Closes #5177
2023-03-24 14:13:14 -05:00
Ayaz Hafiz
db3698c33c
Fix code guards
2023-03-23 11:53:43 -05:00
Ayaz Hafiz
5069d926bb
Update mono tests
2023-03-23 10:18:04 -05:00
Ayaz Hafiz
c7f2a1cfe9
Avoid using builtin types in derive tests
2023-03-22 17:08:43 -05:00
Ayaz Hafiz
84fa22f235
Fix solve test module
2023-03-22 17:08:43 -05:00
Ayaz Hafiz
3e83e42195
Make sure to report error rather than descending as appropriate
2023-03-22 17:08:43 -05:00
Ayaz Hafiz
3d2642b282
Stray dbg
2023-03-22 17:08:42 -05:00
Ayaz Hafiz
e6094df69b
Fast-path for determining ability member impls for builtin opaques
2023-03-22 17:08:41 -05:00
Ayaz Hafiz
297a571b34
Eq for Bool
2023-03-22 17:03:58 -05:00
Ayaz Hafiz
5be8ff700d
Derive encode for bool
2023-03-22 17:03:58 -05:00
Ayaz Hafiz
9563b444cd
Fix test
2023-03-22 17:03:57 -05:00
Ayaz Hafiz
075332ec88
Run builtin opaques and abilities through derive key
2023-03-22 17:03:57 -05:00
Ayaz Hafiz
f079e8c96b
Bool derive key for Decode
2023-03-22 17:03:57 -05:00
Ayaz Hafiz
dba72c0565
Handle builtin opaque types that implement an ability but don't explicitly list so
2023-03-22 17:03:35 -05:00
Ayaz Hafiz
f9f90a3684
Lints
2023-03-22 16:58:12 -05:00
Ayaz Hafiz
1b087df287
Add gen tests for decoding tuples
2023-03-22 16:56:22 -05:00
Ayaz Hafiz
4d3bda51e1
Define naturality of tuple indices
2023-03-22 16:55:23 -05:00
Ayaz Hafiz
cb5a21cb20
Derive decoding for tuples
2023-03-22 16:43:52 -05:00
Folkert de Vries
ffaa4a1c1d
Merge pull request #5178 from roc-lang/i5089
...
Ranged number abilities are derived and compiled correctly
2023-03-22 22:21:18 +01:00
Ayaz Hafiz
e96be7c746
Factor out decoders into separate files
2023-03-22 12:29:21 -05:00
Ayaz Hafiz
5e0a6e5926
Derive key for Decoding tuples
2023-03-22 12:23:16 -05:00
Ayaz Hafiz
92aff265ae
Add doc comment to Decode.record
2023-03-22 12:19:20 -05:00
Ayaz Hafiz
0b3ee77232
Add in Decode.tuple ability member
2023-03-22 12:18:04 -05:00
Ayaz Hafiz
c7bd430026
Gen tests for derived tuple encoding
2023-03-22 11:40:55 -05:00
Ayaz Hafiz
0b4a45c70d
Derive encoding for tuples
2023-03-22 11:37:47 -05:00
Ayaz Hafiz
e5fcb05a2d
Implement derivation keys for tuple encoders
2023-03-22 11:19:47 -05:00
Ayaz Hafiz
a361c4cfc1
Add the tuple
ability member to EncoderFormatting
2023-03-22 11:14:46 -05:00
Ayaz Hafiz
8a7d9f8f23
Better debugging when lambda set region is missing
2023-03-22 11:13:00 -05:00
Ayaz Hafiz
72c9b76f23
Gen Eq test for tuple
2023-03-22 10:55:15 -05:00
Ayaz Hafiz
143f39d273
Gen tests for derivation of tuple hash
2023-03-22 10:53:14 -05:00
Ayaz Hafiz
c32bc5f152
Offset tuple element indices correctly when importing
2023-03-22 10:52:31 -05:00
Ayaz Hafiz
8f7b6aaeaa
Implement hash derivation for tuple
2023-03-22 10:28:13 -05:00
Ayaz Hafiz
66fb2f476e
Pretty-print tuple access
2023-03-22 10:27:49 -05:00
Ayaz Hafiz
d9c7010104
Add derive-key tests for derived hash
2023-03-22 10:19:14 -05:00
Ayaz Hafiz
e6cac71ca5
Add support for hash key of tuples
2023-03-22 10:09:57 -05:00
Ayaz Hafiz
f4f9ae7a5d
Implement obligation checking of tuples for all abilities
2023-03-22 10:03:01 -05:00
Ayaz Hafiz
240c1f35d6
Ranged number abilities are derived and compiled correctly
...
Closes #5089
2023-03-22 09:42:06 -05:00
Ayaz Hafiz
3603183817
Apply opaque pointer recasting to all recursive layouts
2023-03-22 08:21:09 -05:00
Ayaz Hafiz
3a960e7809
Properly recast nested recursion pointers to their expanded layouts as needed
...
When we load a structure with a nested recursive pointer, the pointer
may be loaded opaquely. We need to refine it to the concrete type wanted
by the layout.
This conversion can be removed after we upgrade to LLVM 15.
Closes #5162
2023-03-22 08:21:08 -05:00
Ayaz
6b3f3ba1a1
Merge pull request #5167 from roc-lang/fix-closure-captures-recursive
...
Ensure that closures inside recursive closures capture correctly
2023-03-21 13:53:33 -04:00
Richard Feldman
2276c78d9f
Merge pull request #5093 from roc-lang/glue-getters-rtfeldman
...
Glue for functions and closures
2023-03-21 08:12:19 -04:00
Ayaz Hafiz
700d2d1b31
Check in mono golden
2023-03-21 07:18:12 -04:00
Anton-4
f11bf90d6d
values name change
2023-03-21 11:34:10 +01:00
Ayaz Hafiz
e8a29d2df4
Ensure that closures inside recursive closures capture correctly
...
With a code like
```
thenDo = \x, callback ->
callback x
f = \{} ->
code = 10u16
bf = \{} ->
thenDo code \_ -> bf {}
bf {}
```
The lambda `\_ -> bf {}` must capture `bf`. Previously, this would not
happen correctly, because we assumed that mutually recursive functions
(including singleton recursive functions, like `bf` here) cannot capture
themselves.
Of course, that premise does not hold in general. Instead, we should have
mutually recursive functions capture the closure (haha, get it) of
values captured by all functions constituting the mutual recursion.
Then, any nested closures can capture outer recursive closures' values
appropriately.
2023-03-20 17:44:59 -04:00