Commit graph

87 commits

Author SHA1 Message Date
Richard Feldman
e685eba42b
fix tests 2022-08-03 19:50:17 -04:00
Ayaz Hafiz
fc9ff928eb
Choose non-recursion var when merging arbitrary variables, when possible.
Closes #3669
2022-08-02 08:15:54 -05:00
Ayaz Hafiz
1460f60ab1
Unify material recursion variables behind aliases and opaques
Even if there are no changes to alias arguments, and no new variables were
introduced, we may still need to unify the "actual types" of the alias or opaque!

The unification is not necessary from a types perspective (and in fact, we may want
to disable it for `roc check` later on), but it is necessary for the monomorphizer,
which expects identical types to be reflected in the same variable.

As a concrete example, consider the unification of two opaques

  P := [Zero, Succ P]

  (@P (Succ n)) ~ (@P (Succ o))

`P` has no arguments, and unification of the surface of `P` introduces nothing new.
But if we do not unify the types of `n` and `o`, which are recursion variables, they
will remain disjoint! Currently, the implication of this is that they will be seen
to have separate recursive memory layouts in the monomorphizer - which is no good
for our compilation model.

Closes #3653
2022-07-29 11:03:47 -04:00
Ayaz Hafiz
5df1dfae6f
Update mono tests 2022-07-25 11:44:48 -04:00
Ayaz Hafiz
5988257bde
Reflect newtypes in path instructions 2022-07-21 18:17:57 -04:00
Ayaz Hafiz
1acb7e0748
Don't add path instructions for newtypes that decay into their args 2022-07-21 14:57:17 -04:00
Ayaz Hafiz
52e15bd344
Reproduce #3560
Part of #3560
2022-07-21 12:30:36 -04:00
Ayaz Hafiz
0b74620a8f
Update mono tests 2022-07-18 22:15:22 -04:00
Ayaz Hafiz
c189f27fb0
Fix mono tests 2022-07-18 22:14:47 -04:00
Ayaz Hafiz
17f53a23a5
Update tests 2022-07-18 17:55:02 -04:00
Richard Feldman
518b21c3f8
Rename Json.format to Json.toUtf8 2022-07-17 15:21:27 -04:00
Richard Feldman
f575807834
Merge remote-tracking branch 'origin/trunk' into outdent-infix 2022-07-16 16:08:36 -04:00
Ayaz Hafiz
9a66e936a8
Switch String deriving to be an immediate deriver 2022-07-15 10:39:08 -04:00
Folkert de Vries
460b822caa
Merge pull request #3501 from rtfeldman/derive-tag-union-encoding-gen
Derive tag union encoding gen
2022-07-15 15:57:41 +02:00
Folkert de Vries
1b1b63aad0
Merge branch 'trunk' into assoc-list-dict 2022-07-14 16:47:50 +02:00
Ayaz Hafiz
94ab904b6f
Fix compile errors 2022-07-14 09:02:37 -04:00
Ayaz Hafiz
2ca86c84dc
Gen derived tag encoders with multiple payloads 2022-07-14 08:49:46 -04:00
Ayaz Hafiz
1cf1e114be
Derive tag union encoders 2022-07-14 08:49:45 -04:00
Ayaz Hafiz
9aa3cb8d33
Use Derived_synth for synthesizing implementations, and Derived_gen for codegen 2022-07-14 08:49:45 -04:00
Ayaz Hafiz
8311fb553f
Update mono tests 2022-07-14 08:49:45 -04:00
Ayaz
a9243720da
Merge pull request #3496 from rtfeldman/derive-w-mono
Monomorphize and compile derived implementations
2022-07-14 07:45:21 -05:00
Richard Feldman
7908e8c176
roc format examples 2022-07-13 23:16:09 -04:00
Folkert
5763248b44
Merge remote-tracking branch 'origin/trunk' into assoc-list-dict 2022-07-13 20:44:28 +02:00
Folkert
7456be1771
update mono tests 2022-07-13 19:39:03 +02:00
Richard Feldman
2efb605d68
Update mono tests 2022-07-13 12:20:16 -04:00
Ayaz Hafiz
df9bcb1a0c
Use Derived_synth for synthesizing implementations, and Derived_gen for codegen 2022-07-13 08:47:39 -04:00
Ayaz Hafiz
63adb901b4
A couple hacks to get deriving of records working.. but it's working? 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
91e3bfbd01
Fix tests 2022-07-13 08:47:38 -04:00
Ayaz Hafiz
9826253785
Deriving string encoders works 2022-07-13 08:47:37 -04:00
Ayaz Hafiz
6e1698775f
Make sure to update uls_of_var when importing variables directly to a usage site 2022-07-13 08:47:34 -04:00
Ayaz Hafiz
94142bf474
Remove compiler-file/line-dependent runtime error messages
This will help avoid the diff changes we've been running into often when
changes to mono line numbers change test results.
2022-07-12 15:17:19 -04:00
Folkert
1863bcbd8c
stop using line numbers in unresolved type var messages 2022-07-10 22:17:35 +02:00
Richard Feldman
c45e3ec4b4
Merge remote-tracking branch 'origin/trunk' into fix-nested-imports 2022-07-10 08:52:38 -04:00
Folkert
2163147e42
update mono tests 2022-07-10 11:58:32 +02:00
Folkert de Vries
7a2c2f6d1d
Merge pull request #3460 from rtfeldman/i3456
Correctly compile polymorphic recursive tag unions
2022-07-09 12:44:21 +02:00
Richard Feldman
f45e3dbb46
Fix tests 2022-07-08 18:16:08 -04:00
Ayaz Hafiz
532b2ff403
Support specialization of naked tag unions at toplevel 2022-07-08 17:50:52 -04:00
Ayaz Hafiz
808d19b01b
Correctly compile unified recursive tag unions 2022-07-08 17:35:14 -04:00
Folkert
02fa2eb086
update mono tests 2022-07-08 22:14:16 +02:00
Folkert
c0ace1ee0b
update mono tests 2022-07-08 16:19:12 +02:00
Folkert
24c6b92846
update mono tests 2022-07-08 16:16:42 +02:00
Folkert
6dc0a379b0
update mono tests 2022-07-08 15:39:23 +02:00
Folkert
e6977986c9
update mono tests 2022-07-08 02:57:00 +02:00
Ayaz
22f02984d3
Merge branch 'trunk' into 3378 2022-07-06 20:37:32 -05:00
Ayaz Hafiz
8d2d0b02db
Fix mono tests 2022-07-06 12:57:58 -04:00
ayazhafiz
b6ebb960c9
Update mono tests 2022-07-06 12:49:03 -04:00
ayazhafiz
41e63c8576
Add missing mono test 2022-07-06 12:49:02 -04:00
ayazhafiz
aa90c3dfb6
Unresolved type var for list map unbound function 2022-07-06 12:49:02 -04:00
ayazhafiz
937b73b797
Compile lambdas that have an empty lambda set
Closes #3224

This should also fix a number of other issues often observed when a
lambda is never actually called, but we fail to codegen because it has
an empty lambda set.
2022-07-06 12:49:01 -04:00
Ayaz Hafiz
f940cc18c1
Consolidate calling specialized proc 2022-07-06 09:12:02 -04:00