Suffixed pure function warning

This commit is contained in:
Agus Zubiaga 2024-10-16 16:20:29 -03:00
parent 1da8af390b
commit d22b2a79f5
No known key found for this signature in database
5 changed files with 59 additions and 3 deletions

View file

@ -1543,7 +1543,17 @@ fn check_symbol_suffix(
}
}
IdentSuffix::Bang => {
// [purity-inference] TODO
if let Content::Structure(FlatType::Func(_, _, _, fx)) =
env.subs.get_content_without_compacting(loc_var.value)
{
match env.subs.get_content_without_compacting(*fx) {
// [purity-inference] TODO: Should FlexVar actually be a case?
Content::Pure | Content::FlexVar(_) => {
problems.push(TypeError::SuffixedPureFunction(loc_var.region, symbol));
}
_ => {}
}
}
}
}
}