mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +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
17 lines
436 B
Text
17 lines
436 B
Text
procedure Dict.1 ():
|
|
let Dict.102 : List {[], []} = Array [];
|
|
ret Dict.102;
|
|
|
|
procedure Dict.7 (Dict.96):
|
|
let Dict.101 : U64 = CallByName List.6 Dict.96;
|
|
ret Dict.101;
|
|
|
|
procedure List.6 (#Attr.2):
|
|
let List.385 : U64 = lowlevel ListLen #Attr.2;
|
|
ret List.385;
|
|
|
|
procedure Test.0 ():
|
|
let Test.2 : List {[], []} = CallByName Dict.1;
|
|
let Test.1 : U64 = CallByName Dict.7 Test.2;
|
|
dec Test.2;
|
|
ret Test.1;
|