Commit graph

833 commits

Author SHA1 Message Date
Tom Dohrmann
954064fa1e make more types more explicit 2022-02-25 13:58:07 +01:00
Tom Dohrmann
868316abb8 make types more explicit 2022-02-25 13:02:11 +01:00
Brendan Hansknecht
116b585cdc add more tests 2022-02-24 22:59:47 -08:00
Brendan Hansknecht
889b189191 fix list passing 2022-02-24 22:46:50 -08:00
Brendan Hansknecht
dddf8ff785 switch from pair to record and change name to ListReplaceUnsafe 2022-02-24 20:41:26 -08:00
Brendan Hansknecht
ba2e8cd32b Add base piping for list.Replace 2022-02-24 17:58:56 -08:00
Brendan Hansknecht
f7c0e2ef19 Merge remote-tracking branch 'origin/trunk' into single-quote-literal 2022-02-24 10:13:39 -08:00
Tom Dohrmann
788c8a6af2 reimplement RocList and RocStr 2022-02-23 16:02:13 +01:00
Brian Carroll
3952a7cc7c test_gen: Add comments to some extremely subtle test code 2022-02-21 22:52:50 +00:00
Brian Carroll
89b8926d27 gen_wasm: fix bug choosing the right proc specialization (#2549) 2022-02-21 22:52:45 +00:00
ayazhafiz
dd2b3097e1 Disable WASM test for now 2022-02-21 14:10:46 -05:00
ayazhafiz
475be2363c Add a gen test for #2535 2022-02-21 14:10:46 -05:00
Brendan Hansknecht
74daec84df
Merge pull request #2472 from rtfeldman/add_Int.toInt_builtins
Add `{Int *}.to{Int *}` builtins
2022-02-21 18:03:14 +00:00
Brian Carroll
e8571de1ae
Merge pull request #2517 from rtfeldman/repl-www
Web REPL initial version
2022-02-21 13:58:23 +00:00
Folkert
3e413764e2
make llvm gen tests work 2022-02-20 14:25:26 +01:00
Folkert
177529bfb6
all string tests passing 2022-02-20 13:04:12 +01:00
Brian Carroll
603c98d1d9 wasm tests: use wasmer .unwrap_i32 2022-02-20 09:05:08 +00:00
Brendan Hansknecht
2154e910d8 expand test coverage 2022-02-19 19:39:44 -08:00
Brendan Hansknecht
c6f1edbf47 load literals that are union args 2022-02-19 19:24:37 -08:00
Folkert
2c4d0e71a6
fix string repeat tests 2022-02-20 00:47:07 +01:00
Folkert
dea6cfbc8f
various fixes 2022-02-20 00:20:50 +01:00
ayazhafiz
ee37d8c4e0 Disable unimplemented int casts on wasm 2022-02-19 17:08:20 -05:00
ayazhafiz
25b355eb38 Fix cast tests 2022-02-19 16:24:49 -05:00
ayazhafiz
13067f2908 Implement Num.toNNNChecked
Closes #2411
2022-02-19 16:20:21 -05:00
ayazhafiz
d90915a8cd Implement Num.to* builtins
Just wrap over Num.intCast
2022-02-19 11:28:41 -05:00
Jan Van Bruggen
e12d98af98 WIP: Start adding new Int.toInt builtins 2022-02-19 11:28:12 -05:00
Folkert
5582644166
use str/list helpers to prepare for adding capacity 2022-02-18 22:23:05 +01:00
Folkert
04adbe75ca fix test compilation 2022-02-14 21:09:51 +01:00
hafiz
91483dbf55
Merge pull request #2471 from rtfeldman/fix_args_order
Swap arg order in `List` builtins to put the more-complex types first
2022-02-13 23:25:05 -05:00
ayazhafiz
6e5c1d5914 Specialize Num.toFloat for different target float types
Closes #2476
2022-02-13 20:20:25 -05:00
ayazhafiz
c831b99432 Add test for issue #1162
This was fixed some time ago; add a regression test.

Closes #1162
2022-02-13 14:02:39 -05:00
Brian Carroll
a9df6f4ff9 test_gen: create a getter for wasm panic messages 2022-02-12 00:19:52 +00:00
Jan Van Bruggen
f47dbb5171
Swap List.mapWithIndex arg1 args order to put the element first 2022-02-11 16:10:29 -07:00
Jan Van Bruggen
92e0f8714f
Swap List.repeat args order to put the list first 2022-02-11 16:10:29 -07: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
Brian Carroll
57179eb458 test_gen: comments about wasm panics 2022-02-11 08:12:36 +00:00
Brian Carroll
5f64f32a4a wasm: Better implementation of roc_panic in tests 2022-02-11 07:33:49 +00:00
Brian Carroll
2af4016f34 wasm: improve the HTML debugger's WASI syscall implementations 2022-02-10 10:15:59 +00:00
Brian Carroll
0d08c97e44 wasm: enable a test that has a Stmt::RuntimeError 2022-02-09 17:23:36 +00:00
Brian Carroll
abfa4b1522 test_gen: allow non-llvm tests to expect errors 2022-02-09 17:23:36 +00:00
Brian Carroll
cff762afe5 Fix test_gen llvm 2022-02-08 11:03:48 +00:00
Brian Carroll
c21b2bd0da Formatting and Clippy 2022-02-08 11:03:48 +00:00
Brian Carroll
85b418ebdf wasm: get rid of Result from gen_wasm, rename a function, improve comments 2022-02-08 11:03:48 +00:00
Brian Carroll
2fd2a85887 wasm: delete redundant enum TestType 2022-02-08 11:03:48 +00:00
Brian Carroll
c5ccc99e20 repl: rename Wasm32TestResult -> Wasm32Result 2022-02-08 11:03:48 +00:00
Brian Carroll
1783fa8009 repl: rename FromWasm32Memory -> FromWasmerMemory 2022-02-08 11:03:48 +00:00
Brian Carroll
e9871947d3 repl: move wasm32_test_result to gen_wasm, and extract Wasm32Sized from FromWasm32Memory 2022-02-08 11:03:48 +00:00
Brian Carroll
aaa5fa04cd wasm: delete obsolete code 2022-02-08 11:03:48 +00:00
ayazhafiz
40196185a0 Specialize zero-argument thunks with the correct variable
Previously we would pass the annotation down as the
type-to-be-monomorphized for, but that would just mean the annotation
would unify with itself. We instead want to use the variable the thunk
is being used as to be the one unified with the thunk's annotation.

Closes #2445
Closes #2446
2022-02-06 20:58:13 -05:00
ayazhafiz
ff3596505e Fix gen tests 2022-02-06 15:04:12 -05:00