mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Treat untyped suffixed functions as effectful
This commit is contained in:
parent
af6fc6306f
commit
cfc4be5254
25 changed files with 139 additions and 21 deletions
|
@ -81,7 +81,7 @@ impl FlatDecodable {
|
|||
Err(Underivable) // yet
|
||||
}
|
||||
//
|
||||
FlatType::Func(..) => Err(Underivable),
|
||||
FlatType::Func(..) | FlatType::EffectfulFunc => Err(Underivable),
|
||||
},
|
||||
Content::Alias(sym, _, real_var, _) => match from_builtin_symbol(sym) {
|
||||
Some(lambda) => lambda,
|
||||
|
|
|
@ -117,7 +117,7 @@ impl FlatEncodable {
|
|||
}
|
||||
FlatType::EmptyRecord => Ok(Key(FlatEncodableKey::Record(vec![]))),
|
||||
FlatType::EmptyTagUnion => Ok(Key(FlatEncodableKey::TagUnion(vec![]))),
|
||||
FlatType::Func(..) => Err(Underivable),
|
||||
FlatType::Func(..) | FlatType::EffectfulFunc => Err(Underivable),
|
||||
},
|
||||
Content::Alias(sym, _, real_var, _) => match from_builtin_symbol(sym) {
|
||||
Some(lambda) => lambda,
|
||||
|
|
|
@ -112,7 +112,7 @@ impl FlatHash {
|
|||
FlatType::EmptyRecord => Ok(Key(FlatHashKey::Record(vec![]))),
|
||||
FlatType::EmptyTagUnion => Ok(Key(FlatHashKey::TagUnion(vec![]))),
|
||||
//
|
||||
FlatType::Func(..) => Err(Underivable),
|
||||
FlatType::Func(..) | FlatType::EffectfulFunc => Err(Underivable),
|
||||
},
|
||||
Content::Alias(sym, _, real_var, _) => match builtin_symbol_to_hash_lambda(sym) {
|
||||
Some(lambda) => Ok(lambda),
|
||||
|
|
|
@ -129,6 +129,9 @@ impl FlatInspectable {
|
|||
FlatType::EmptyRecord => Key(FlatInspectableKey::Record(Vec::new())),
|
||||
FlatType::EmptyTagUnion => Key(FlatInspectableKey::TagUnion(Vec::new())),
|
||||
FlatType::Func(..) => Immediate(Symbol::INSPECT_FUNCTION),
|
||||
FlatType::EffectfulFunc => {
|
||||
unreachable!("There must have been a bug in the solver, because we're trying to derive Inspect on a non-concrete type.");
|
||||
}
|
||||
},
|
||||
Content::Alias(sym, _, real_var, kind) => match Self::from_builtin_alias(sym) {
|
||||
Some(lambda) => lambda,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue