mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 07:41:12 +00:00
Specialize zero-argument thunks with the correct variable
Previously we would pass the annotation down as the type-to-be-monomorphized for, but that would just mean the annotation would unify with itself. We instead want to use the variable the thunk is being used as to be the one unified with the thunk's annotation. Closes #2445 Closes #2446
This commit is contained in:
parent
365b3bb9c0
commit
40196185a0
2 changed files with 26 additions and 2 deletions
|
@ -2941,8 +2941,7 @@ fn specialize_naked_symbol<'a>(
|
|||
symbol: Symbol,
|
||||
) -> Stmt<'a> {
|
||||
if procs.is_module_thunk(symbol) {
|
||||
let partial_proc = procs.get_partial_proc(symbol).unwrap();
|
||||
let fn_var = partial_proc.annotation;
|
||||
let fn_var = variable;
|
||||
|
||||
// This is a top-level declaration, which will code gen to a 0-arity thunk.
|
||||
let result = call_by_name(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue