Ayaz Hafiz
7797412aef
Drop unused functions
2023-04-20 17:57:18 -05:00
Ayaz Hafiz
721d3836cd
Migrate even more tests
2023-04-20 16:18:23 -05:00
Ayaz Hafiz
7c14b78e5d
Migrate more tests
2023-04-20 16:18:23 -05:00
Ayaz Hafiz
014ec8c092
Support multiple modules in uitest
2023-04-12 11:35:33 -05:00
Ayaz Hafiz
aa7fb75f3e
Drop infer_queries macro
2023-04-02 13:16:04 -05:00
Ayaz Hafiz
c57aaecad4
Migrate pattern tests
2023-04-02 13:15:36 -05:00
Ayaz Hafiz
67364e1a42
Migrate polymorphic lambda set specialization tests
2023-04-02 13:12:51 -05:00
Ayaz Hafiz
e72e17fc82
Migrate list_of_lambdas
2023-04-02 13:03:18 -05:00
Ayaz Hafiz
88b044a765
Migrate ability resolution tests
2023-04-02 13:02:01 -05:00
Ayaz Hafiz
05af17af43
Migrate even more tests
2023-04-02 12:56:01 -05:00
Ayaz Hafiz
2dcafffb46
Migrate couple more tests
2023-04-02 12:53:06 -05:00
Ayaz Hafiz
bc7e6c4340
Unused test
2023-04-02 12:50:19 -05:00
Ayaz Hafiz
6b3a4b419e
Migrate even more tests
2023-03-31 19:05:10 -05:00
Ayaz Hafiz
61adcd34d2
Migrate more tests
2023-03-31 18:35:45 -05:00
Ayaz Hafiz
906f2349b8
Remove migrated test
2023-03-31 18:02:10 -05:00
Ayaz Hafiz
fadd3e7e4a
Remove migrated test
2023-03-31 14:35:21 -05:00
Ayaz Hafiz
a10ce77584
Support printing can decls in uitest
2023-03-31 14:34:06 -05:00
Ayaz Hafiz
d891dd829f
Migrate more tests
2023-03-31 14:06:49 -05:00
Ayaz Hafiz
834f4afe2c
Add more tests
2023-03-31 13:56:46 -05:00
Ayaz Hafiz
3fc54ea578
Migrate a few more tests
2023-03-31 13:45:06 -05:00
Ayaz Hafiz
58cef56a23
Move solve test helpers to their own crate, for now
2023-03-31 11:35:23 -05:00
Ayaz Hafiz
1227d10731
Refactor solve test helpers into a new module
2023-03-31 11:18:24 -05:00
Ayaz Hafiz
f458da0cbc
Implement Hash for Bool
2023-03-28 15:04:45 -05:00
Ayaz Hafiz
d2b9a1a33c
Improve debug printing for can decls
2023-03-27 10:10:56 -05:00
Ayaz Hafiz
84fa22f235
Fix solve test module
2023-03-22 17:08:43 -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
f079e8c96b
Bool derive key for Decode
2023-03-22 17:03:57 -05: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
Ayaz Hafiz
b406e384fc
Print recursion variables correctly in pretty printer
2023-02-13 17:42:21 -06:00
Joshua Warner
5a6be05ead
implement mono / lowering for tuples
2023-02-07 18:54:50 -08:00
Joshua Warner
303e5bceb3
Fix tuple accessor type printing
2023-01-22 13:22:39 -08:00
Joshua Warner
de828416bf
Initial implementation of tuples in type checking
...
This leaves in place a bunch of TODOs and likely many bugs - notably, I haven't tested codegen/layout at all here.
2023-01-22 12:40:44 -08:00
Ayaz Hafiz
c3f1646274
Weaken ability members behind let-bindings
2023-01-16 10:49:17 -06:00
Ayaz Hafiz
48049ed956
Weaken tags behind let bindings
2023-01-16 10:49:17 -06:00
Ayaz Hafiz
52c2f3a054
Weaken zero-argument tags in let bindings
2023-01-16 10:49:16 -06:00
Ayaz Hafiz
b8712bcb30
Weaken records in let-bindings
...
This change also means we must update the interface of `Dict.empty` and
`Set.empty` from
```
Dict.empty : Dict k v
```
to
```
Dict.empty : {} -> Dict k v
```
2023-01-14 15:33:51 +01:00
Ayaz Hafiz
cb1373a3a4
Weaken let-binding calls
2023-01-14 15:33:49 +01:00
Ayaz Hafiz
d27a72de1f
Weaken let sequences under let binding
2023-01-14 15:33:49 +01:00
Ayaz Hafiz
9462f44bb7
Weaken variables bound to when expressions
2023-01-12 10:02:21 -06:00
Ayaz Hafiz
b2cdddbdfb
Weaken lists
2023-01-12 10:02:20 -06:00
Ayaz Hafiz
058644aa96
Implement weakening of variables introduced in branch patterns
...
Variables introduced in branch patterns should never be generalized in
the new weakening model. This implements that. The strategy is:
- when we have a let-binding that should be weakened, do not introduce
its bound variables in a new (higher) rank
- instead, introduce them at the current rank, and also solve the
let-binding at the current rank
- if any of those variables should then be generalized relative to the
current rank, they will be so when the current rank is popped and
generalized
2023-01-11 14:28:46 -06:00
Ayaz Hafiz
dc30dbc8a4
Add rank-generalization test
2023-01-10 12:46:34 -06:00
Ayaz
7c61d0d278
Merge pull request #4843 from roc-lang/pattern-as-can
...
Pattern as can
2023-01-08 19:36:40 -06:00
Folkert
c2ddeb0de0
fix and test as pattern type inference
2023-01-08 16:40:03 +01:00
Ayaz Hafiz
3b0e2429e6
Support printing weak type variables in tests
...
Unbound type variables that are not at the generalization rank will now
be printed as `w_a` in solve tests.
2023-01-04 16:24:19 -06:00
Folkert
26e5ac85d4
remove argument from the from_str functions
2022-12-29 16:50:19 +01:00
Joshua Warner
174f7d5e4d
Fix bug in unifying records
...
This was leading us to have an infinitely-recursive type, which eventually causes layout to stack-overflow
Fixes #4739
2022-12-17 11:37:19 -08:00
Ayaz Hafiz
bd06714fd2
Make sure to constrain dbgs with existential correctly
2022-12-14 17:02:29 -06:00