Fix unique names

This commit is contained in:
Brian Carroll 2021-12-24 18:05:05 +00:00
parent da4cf721cc
commit d08b79295c

View file

@ -293,15 +293,16 @@ impl<'a> CodeGenHelp<'a> {
return spec.proc.name; return spec.proc.name;
} }
let (proc_symbol, proc_layout) = self.create_proc_symbol(ident_ids, ctx, &layout); // Generate the body of the Proc (and recursively generate any sub-procs)
ctx.new_linker_data.push((proc_symbol, proc_layout));
// Generate the body of the Proc
let (ret_layout, body) = match ctx.op { let (ret_layout, body) = match ctx.op {
Inc | Dec | DecRef => (LAYOUT_UNIT, self.refcount_generic(ident_ids, ctx, layout)), Inc | Dec | DecRef => (LAYOUT_UNIT, self.refcount_generic(ident_ids, ctx, layout)),
Eq => (LAYOUT_BOOL, self.eq_generic(ident_ids, ctx, layout)), Eq => (LAYOUT_BOOL, self.eq_generic(ident_ids, ctx, layout)),
}; };
// Give it a name (must come after the recursive call for the body)
let (proc_symbol, proc_layout) = self.create_proc_symbol(ident_ids, ctx, &layout);
ctx.new_linker_data.push((proc_symbol, proc_layout));
let args: &'a [(Layout<'a>, Symbol)] = { let args: &'a [(Layout<'a>, Symbol)] = {
let roc_value = (layout, ARG_1); let roc_value = (layout, ARG_1);
match ctx.op { match ctx.op {