roc/crates/compiler/test_mono/generated/encode.txt
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

34 lines
1.1 KiB
Text

procedure List.4 (List.101, List.102):
let List.387 : U64 = 1i64;
let List.386 : List U8 = CallByName List.70 List.101 List.387;
let List.385 : List U8 = CallByName List.71 List.386 List.102;
ret List.385;
procedure List.70 (#Attr.2, #Attr.3):
let List.389 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3;
ret List.389;
procedure List.71 (#Attr.2, #Attr.3):
let List.388 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3;
ret List.388;
procedure Test.23 (Test.24, Test.35, #Attr.12):
let Test.22 : U8 = StructAtIndex 0 #Attr.12;
let Test.37 : List U8 = CallByName List.4 Test.24 Test.22;
ret Test.37;
procedure Test.8 (Test.22):
let Test.34 : {U8} = Struct {Test.22};
ret Test.34;
procedure Test.9 (Test.27):
let Test.33 : {U8} = CallByName Test.8 Test.27;
ret Test.33;
procedure Test.0 ():
let Test.32 : U8 = 15i64;
let Test.28 : {U8} = CallByName Test.9 Test.32;
let Test.30 : List U8 = Array [];
let Test.31 : {} = Struct {};
let Test.29 : List U8 = CallByName Test.23 Test.30 Test.31 Test.28;
ret Test.29;