mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00

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
83 lines
3 KiB
Text
83 lines
3 KiB
Text
procedure List.2 (List.90, List.91):
|
|
let List.400 : U64 = CallByName List.6 List.90;
|
|
let List.397 : Int1 = CallByName Num.22 List.91 List.400;
|
|
if List.397 then
|
|
let List.399 : I64 = CallByName List.66 List.90 List.91;
|
|
let List.398 : [C {}, C I64] = TagId(1) List.399;
|
|
ret List.398;
|
|
else
|
|
let List.396 : {} = Struct {};
|
|
let List.395 : [C {}, C I64] = TagId(0) List.396;
|
|
ret List.395;
|
|
|
|
procedure List.3 (List.98, List.99, List.100):
|
|
let List.388 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100;
|
|
let List.387 : List I64 = StructAtIndex 0 List.388;
|
|
inc List.387;
|
|
dec List.388;
|
|
ret List.387;
|
|
|
|
procedure List.6 (#Attr.2):
|
|
let List.406 : U64 = lowlevel ListLen #Attr.2;
|
|
ret List.406;
|
|
|
|
procedure List.64 (List.95, List.96, List.97):
|
|
let List.405 : U64 = CallByName List.6 List.95;
|
|
let List.402 : Int1 = CallByName Num.22 List.96 List.405;
|
|
if List.402 then
|
|
let List.403 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97;
|
|
ret List.403;
|
|
else
|
|
let List.401 : {List I64, I64} = Struct {List.95, List.97};
|
|
ret List.401;
|
|
|
|
procedure List.66 (#Attr.2, #Attr.3):
|
|
let List.407 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3;
|
|
ret List.407;
|
|
|
|
procedure List.67 (#Attr.2, #Attr.3, #Attr.4):
|
|
let List.404 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4;
|
|
ret List.404;
|
|
|
|
procedure Num.22 (#Attr.2, #Attr.3):
|
|
let Num.259 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;
|
|
ret Num.259;
|
|
|
|
procedure Test.1 (Test.2, Test.3, Test.4):
|
|
let Test.29 : [C {}, C I64] = CallByName List.2 Test.4 Test.3;
|
|
let Test.28 : [C {}, C I64] = CallByName List.2 Test.4 Test.2;
|
|
let Test.13 : {[C {}, C I64], [C {}, C I64]} = Struct {Test.28, Test.29};
|
|
joinpoint Test.25:
|
|
let Test.16 : List I64 = Array [];
|
|
ret Test.16;
|
|
in
|
|
let Test.22 : [C {}, C I64] = StructAtIndex 1 Test.13;
|
|
let Test.23 : U8 = 1i64;
|
|
let Test.24 : U8 = GetTagId Test.22;
|
|
let Test.27 : Int1 = lowlevel Eq Test.23 Test.24;
|
|
if Test.27 then
|
|
let Test.19 : [C {}, C I64] = StructAtIndex 0 Test.13;
|
|
let Test.20 : U8 = 1i64;
|
|
let Test.21 : U8 = GetTagId Test.19;
|
|
let Test.26 : Int1 = lowlevel Eq Test.20 Test.21;
|
|
if Test.26 then
|
|
let Test.18 : [C {}, C I64] = StructAtIndex 0 Test.13;
|
|
let Test.6 : I64 = UnionAtIndex (Id 1) (Index 0) Test.18;
|
|
let Test.17 : [C {}, C I64] = StructAtIndex 1 Test.13;
|
|
let Test.8 : I64 = UnionAtIndex (Id 1) (Index 0) Test.17;
|
|
let Test.15 : List I64 = CallByName List.3 Test.4 Test.2 Test.8;
|
|
let Test.14 : List I64 = CallByName List.3 Test.15 Test.3 Test.6;
|
|
ret Test.14;
|
|
else
|
|
dec Test.4;
|
|
jump Test.25;
|
|
else
|
|
dec Test.4;
|
|
jump Test.25;
|
|
|
|
procedure Test.0 ():
|
|
let Test.10 : U64 = 0i64;
|
|
let Test.11 : U64 = 0i64;
|
|
let Test.12 : List I64 = Array [1i64];
|
|
let Test.9 : List I64 = CallByName Test.1 Test.10 Test.11 Test.12;
|
|
ret Test.9;
|