mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00

This ensures that we use the correct specialized variable at the call site of a function. In #2725 what happened was that a generalized function was aliased, causing it to undergo generalization again. Then, we lost the variable used to specialize at the call site. Instead, just link to the partial proc being aliased directly. There is an added benefit here, which is that we can avoid the possibly-quadratic replacement of symbols in the generated statement. Closes #2725
53 lines
1.6 KiB
Text
53 lines
1.6 KiB
Text
procedure Num.22 (#Attr.2, #Attr.3):
|
|
let Test.28 : I64 = lowlevel NumAdd #Attr.2 #Attr.3;
|
|
ret Test.28;
|
|
|
|
procedure Num.24 (#Attr.2, #Attr.3):
|
|
let Test.25 : I64 = lowlevel NumMul #Attr.2 #Attr.3;
|
|
ret Test.25;
|
|
|
|
procedure Test.1 (Test.2, Test.3):
|
|
let Test.17 : U8 = GetTagId Test.2;
|
|
joinpoint Test.18 Test.16:
|
|
ret Test.16;
|
|
in
|
|
switch Test.17:
|
|
case 0:
|
|
let Test.19 : I64 = CallByName Test.7 Test.3 Test.2;
|
|
jump Test.18 Test.19;
|
|
|
|
default:
|
|
let Test.20 : I64 = CallByName Test.8 Test.3 Test.2;
|
|
jump Test.18 Test.20;
|
|
|
|
|
|
procedure Test.7 (Test.10, #Attr.12):
|
|
let Test.4 : I64 = UnionAtIndex (Id 0) (Index 0) #Attr.12;
|
|
let Test.27 : I64 = CallByName Num.22 Test.10 Test.4;
|
|
ret Test.27;
|
|
|
|
procedure Test.8 (Test.11, #Attr.12):
|
|
let Test.6 : Int1 = UnionAtIndex (Id 1) (Index 1) #Attr.12;
|
|
let Test.5 : I64 = UnionAtIndex (Id 1) (Index 0) #Attr.12;
|
|
if Test.6 then
|
|
let Test.24 : I64 = CallByName Num.24 Test.11 Test.5;
|
|
ret Test.24;
|
|
else
|
|
ret Test.11;
|
|
|
|
procedure Test.0 ():
|
|
let Test.5 : I64 = 2i64;
|
|
let Test.6 : Int1 = true;
|
|
let Test.4 : I64 = 1i64;
|
|
joinpoint Test.22 Test.14:
|
|
let Test.15 : I64 = 42i64;
|
|
let Test.13 : I64 = CallByName Test.1 Test.14 Test.15;
|
|
ret Test.13;
|
|
in
|
|
let Test.26 : Int1 = true;
|
|
if Test.26 then
|
|
let Test.7 : [C I64, C I64 Int1] = ClosureTag(Test.7) Test.4;
|
|
jump Test.22 Test.7;
|
|
else
|
|
let Test.8 : [C I64, C I64 Int1] = ClosureTag(Test.8) Test.5 Test.6;
|
|
jump Test.22 Test.8;
|