Report effectful top-level exprs

This commit is contained in:
Agus Zubiaga 2024-10-16 19:29:08 -03:00
parent b62665e49e
commit f666dba67d
No known key found for this signature in database
5 changed files with 61 additions and 4 deletions

View file

@ -1891,7 +1891,7 @@ fn constrain_call_fx(
))
}
None => constraints.push_expected_type(ForReason(
Reason::CallInTopLevelDef,
Reason::CallInTopLevel,
// top-level defs are only allowed to call pure functions
constraints.push_variable(Variable::PURE),
region,