Treat untyped suffixed functions as effectful

This commit is contained in:
Agus Zubiaga 2024-10-23 22:33:57 -03:00
parent af6fc6306f
commit cfc4be5254
No known key found for this signature in database
25 changed files with 139 additions and 21 deletions

View file

@ -984,7 +984,7 @@ fn deep_copy_type_vars<C: CopyEnv>(
// Everything else is a mechanical descent.
Structure(flat_type) => match flat_type {
EmptyRecord | EmptyTagUnion => Structure(flat_type),
EmptyRecord | EmptyTagUnion | EffectfulFunc => Structure(flat_type),
Apply(symbol, arguments) => {
descend_slice!(arguments);

View file

@ -153,6 +153,7 @@ fn index_var(
}
Content::Structure(structure) => match structure {
FlatType::Func(_, _, _, _) => return Err(TypeError),
FlatType::EffectfulFunc => return Err(TypeError),
FlatType::Apply(Symbol::LIST_LIST, args) => {
match (subs.get_subs_slice(*args), ctor) {
([elem_var], IndexCtor::List) => {