mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 03:42:17 +00:00

Fix a bug in `dbg` expression desugaring by using the module scope to generate unique identifiers instead of the variable store. In the initial implementation of `dbg` expressions we used the `VarStore` to generate unique identifiers for new variables created during desugaring. We should have instead used the current module's `Scope`, which handles identifiers within the module. Each scope has its own incrementing variable count which is independent of the shared variable store. The scope is used to generate new identifiers at other points in canonicalization, such as when assigning a global identifier to closures and `expect`s. It's possible that the identifier generated for `dbg` could conflict with an identifier generated by the scope, resulting in a confusing error.
58 lines
1.8 KiB
Text
Generated
58 lines
1.8 KiB
Text
Generated
procedure Inspect.250 (Inspect.251, Inspect.249):
|
|
let Inspect.323 : Str = "\"";
|
|
let Inspect.322 : Str = CallByName Inspect.63 Inspect.251 Inspect.323;
|
|
dec Inspect.323;
|
|
let Inspect.318 : Str = CallByName Inspect.63 Inspect.322 Inspect.249;
|
|
let Inspect.319 : Str = "\"";
|
|
let Inspect.317 : Str = CallByName Inspect.63 Inspect.318 Inspect.319;
|
|
dec Inspect.319;
|
|
ret Inspect.317;
|
|
|
|
procedure Inspect.30 (Inspect.147):
|
|
ret Inspect.147;
|
|
|
|
procedure Inspect.33 (Inspect.152):
|
|
let Inspect.305 : Str = CallByName Inspect.5 Inspect.152;
|
|
let Inspect.304 : Str = CallByName Inspect.64 Inspect.305;
|
|
ret Inspect.304;
|
|
|
|
procedure Inspect.39 (Inspect.301):
|
|
let Inspect.311 : Str = "";
|
|
ret Inspect.311;
|
|
|
|
procedure Inspect.47 (Inspect.249):
|
|
let Inspect.313 : Str = CallByName Inspect.30 Inspect.249;
|
|
ret Inspect.313;
|
|
|
|
procedure Inspect.5 (Inspect.150):
|
|
let Inspect.312 : Str = CallByName Inspect.47 Inspect.150;
|
|
let Inspect.309 : {} = Struct {};
|
|
let Inspect.308 : Str = CallByName Inspect.39 Inspect.309;
|
|
let Inspect.307 : Str = CallByName Inspect.250 Inspect.308 Inspect.312;
|
|
dec Inspect.312;
|
|
ret Inspect.307;
|
|
|
|
procedure Inspect.63 (Inspect.300, Inspect.296):
|
|
let Inspect.321 : Str = CallByName Str.3 Inspect.300 Inspect.296;
|
|
ret Inspect.321;
|
|
|
|
procedure Inspect.64 (Inspect.302):
|
|
ret Inspect.302;
|
|
|
|
procedure Str.3 (#Attr.2, #Attr.3):
|
|
let Str.238 : Str = lowlevel StrConcat #Attr.2 #Attr.3;
|
|
ret Str.238;
|
|
|
|
procedure Test.0 ():
|
|
let Test.5 : Str = "Hello ";
|
|
let Test.2 : Str = "world";
|
|
inc Test.2;
|
|
let Test.3 : Str = CallByName Inspect.33 Test.2;
|
|
dbg Test.3;
|
|
dec Test.3;
|
|
let Test.8 : Str = "!";
|
|
let Test.6 : Str = CallByName Str.3 Test.2 Test.8;
|
|
dec Test.8;
|
|
let Test.4 : Str = CallByName Str.3 Test.5 Test.6;
|
|
dec Test.6;
|
|
ret Test.4;
|