mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-22 08:17:40 +03:00
Constrain function type on closure type, not signature
This commit is contained in:
parent
8310230f78
commit
54e977be2d
@ -1510,8 +1510,12 @@ fn constrain_function_def(
|
||||
loc_symbol.value,
|
||||
Loc {
|
||||
region: loc_function_def.region,
|
||||
// todo can we use Type::Variable(expr_var) here?
|
||||
value: signature.clone(),
|
||||
// NOTE: we MUST use `expr_var` here so that the correct type variable is
|
||||
// associated with the function. We prefer this to the annotation type, because the
|
||||
// annotation type may be instantiated into a fresh type variable that is
|
||||
// disassociated fromt the rest of the program.
|
||||
// Below, we'll check that the function actually matches the annotation.
|
||||
value: Type::Variable(expr_var),
|
||||
},
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user