Ayaz Hafiz
d660016b53
Clippy
2022-12-03 23:43:47 -06:00
Ayaz Hafiz
e296d35bcd
Skip testing two mono tests for now
2022-12-03 22:43:19 -06:00
Ayaz Hafiz
01dea13b49
Pretty print symbols
2022-12-03 22:33:45 -06:00
Ayaz Hafiz
b0300e4e90
Fix bug in resolving layout
2022-12-03 22:18:15 -06:00
Ayaz Hafiz
7b21936d4f
Add mono checker to tests
2022-12-03 22:10:37 -06:00
Ayaz Hafiz
6e72307736
Format problems reported by the IR checker
2022-12-03 21:35:01 -06:00
Ayaz Hafiz
a84aebf2d3
Implement a type checker for the mono IR
2022-12-03 18:24:03 -06:00
Brendan Hansknecht
8e710cb80e
disable wasm tests that are broken
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
1dd0738eba
update mono test for dict again
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
04bd5d6ab0
disable wasm dictionary small string test
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
ab6c652360
manually do 128 bit multiplication to avoid bitshift and fix wasm tests
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
436bfc41ed
disable glue test and update mono test
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
ae58623f70
use crash to clearify unreachable state
2022-12-03 13:17:36 -08:00
Brendan Hansknecht
b4b18cda5a
fix formatting
2022-12-03 13:17:35 -08:00
Brendan Hansknecht
ac2380f6c8
swap based on dataIndex not raw hash map index
2022-12-03 13:17:35 -08:00
Brendan Hansknecht
8a30615a20
fix swap remove ordering
2022-12-03 13:17:35 -08:00
Ayaz Hafiz
24a136095c
Add Set.toList from empty test
2022-12-03 13:17:35 -08:00
Ayaz Hafiz
6adcaa2cbd
Extend ability symbol slice when merging in subs
2022-12-03 13:17:35 -08:00
Brendan Hansknecht
4befccc6b4
expand Set test cases
2022-12-03 13:17:35 -08:00
Brendan Hansknecht
cad7d8b4e9
add walkUntil and use it to implement set equality
2022-12-03 13:17:35 -08:00
Ayaz Hafiz
4159b83214
Fix imports
2022-12-03 13:17:35 -08:00
Ayaz Hafiz
2e56405c1e
Fix obligation checking for rigid able vars
2022-12-03 13:17:34 -08:00
Brendan Hansknecht
a321e36a36
update mono test for dict
2022-12-03 13:17:34 -08:00
Brendan Hansknecht
28835d5bf3
some bug fixes
2022-12-03 13:17:34 -08:00
Brendan Hansknecht
4fc0dd9dd9
add a some tests and bug fixes
2022-12-03 13:17:34 -08:00
Brendan Hansknecht
02824e92fe
add Set implementation
2022-12-03 13:17:34 -08:00
Brendan Hansknecht
cb08dca6f1
Add an indexmap like dict to roc
2022-12-03 13:17:34 -08:00
Ayaz
c61c42bff7
Merge pull request #4661 from roc-lang/roc-test-dev
...
`test` has `dev` behavior, and `dev` does not exit if there are warnings
2022-12-03 12:26:00 -06:00
Ayaz
012810d7e8
Merge pull request #4664 from roc-lang/i2551
...
Ensure that llvm gen_ wrappers account different recursive pointers
2022-12-02 17:39:26 -06:00
Ayaz Hafiz
7562525e96
Bugfix match
2022-12-02 16:31:47 -06:00
Ayaz Hafiz
304b88cdb2
Fix bug in expect test
2022-12-02 16:20:56 -06:00
Ayaz Hafiz
705ce10085
New problem dropped
2022-12-02 14:14:18 -06:00
Ayaz Hafiz
8e2c2e1809
It's an error to expose values that aren't defined
2022-12-02 14:11:58 -06:00
Ayaz Hafiz
37c689841a
dev/test don't exit early for warnings
2022-12-02 14:11:58 -06:00
Ayaz Hafiz
39f89e3d65
Get severity from type problem variants
2022-12-02 14:11:58 -06:00
Ayaz Hafiz
5414b4b60f
Fix imports
2022-12-02 14:11:58 -06:00
Ayaz Hafiz
e438fbf37c
Enumerate severity on problem variants
2022-12-02 14:11:57 -06:00
Ayaz Hafiz
0a4ec1958b
roc test stops if there are type errors
2022-12-02 14:11:57 -06:00
Ayaz
b5a195eaf0
Merge pull request #4650 from roc-lang/detect-reachable-by-recursion-only
...
Provide warning for defs that are used only in (mutual) recursion
2022-12-02 13:39:52 -06:00
Ayaz Hafiz
3685ad2ed2
Ensure that llvm gen_ wrappers account different recursive pointers
...
Closes #2551
2022-12-02 13:38:32 -06:00
Folkert
7c6cc97cd4
Merge remote-tracking branch 'origin/main' into expect-print-values
2022-12-02 20:28:04 +01:00
Ayaz Hafiz
5cfbc49ebf
Remove needless hole translation
2022-12-02 12:21:44 -06:00
Ayaz Hafiz
52c858dc53
Remove aliases in partial procs
...
This is no longer needed
2022-12-02 12:19:13 -06:00
Ayaz Hafiz
0f6f34983f
Remove stale comment
2022-12-02 11:50:12 -06:00
Ayaz Hafiz
947808bbb3
Checking if a connected component has a bridge needs to look at all edges
...
With a graph
A -> B
if we visit the order B, A to collect SCCs, we won't see that B has
pre-order edges until we look at A.
2022-12-02 11:50:12 -06:00
Ayaz Hafiz
0a807dc43e
Provide warning for defs that are used only in (mutual) recursion
...
This patch provides errors for defs that are used only in
possibly-mutual recursion, and are not reachable outside of their
recursive closures. For example:
```
test_report!(
mutual_recursion_not_reached_nested,
indoc!(
r#"
app "test" provides [main] to "./platform"
main =
f = \{} -> if Bool.true then "" else g {}
g = \{} -> if Bool.true then "" else f {}
""
"#
),
@r###"
── DEFINITIONs ONLY USED IN RECURSION ──────────────────── /code/proj/Main.roc ─
These 2 definitions are only used in mutual recursion with themselves:
4│> f = \{} -> if Bool.true then "" else g {}
5│> g = \{} -> if Bool.true then "" else f {}
If you don't intend to use or export any of them, they should all be
removed!
"###
);
```
2022-12-02 11:50:12 -06:00
Ayaz Hafiz
34328ddf0c
Unused import
2022-12-02 08:50:04 -06:00
Ayaz Hafiz
078f0147ee
Do not bind accessors in toplevel thunks to their thunks' names
...
In #3352 an optimization to transform `ra = .field` into
```
ra = \#rcd -[ra]-> #rcd.field
```
rather than
```
__ra1 = \#rcd -[__ra1] -> #rcd.field
ra = LambdaSet { __ra1 }
```
was introduced. However, this optimization is not correct when `ra =
.field` is defined as a toplevel thunk, for in such situations we
indeed want the thunk `ra` to return the lambda set it resolves to,
rather than repointing at itself.
Besides reverting this change, another option would be to convert
accessors into closures before translation of Can to IR. However, this
complicates the translation algorithm more than it already is, and I'd
like to avoid additional special-cases.
Closes #4606
2022-12-02 08:50:03 -06:00
Ayaz Hafiz
22a84c8b21
Add comment for is_function
2022-12-02 08:49:14 -06:00
Folkert
1e41aac0f2
lookup symbols when coming from Defs
2022-12-02 15:43:48 +01:00