Add custom CalledVia for naked param vars

This commit is contained in:
Agus Zubiaga 2024-08-27 13:39:20 -03:00
parent 49a6b1bfba
commit 8b9cb22f49
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View file

@ -495,8 +495,7 @@ impl<'a> LowerParams<'a> {
let body = Call(
call_fn,
call_arguments,
// todo: custom called via
roc_module::called_via::CalledVia::Space,
roc_module::called_via::CalledVia::NakedParamsVar,
);
let captured_symbols = if symbol.module_id() == self.home_id
@ -539,8 +538,7 @@ impl<'a> LowerParams<'a> {
Call(
call_fn,
vec![params_arg],
// todo: custom called via
roc_module::called_via::CalledVia::Space,
roc_module::called_via::CalledVia::NakedParamsVar,
)
}
}

View file

@ -99,6 +99,9 @@ pub enum CalledVia {
/// This call is the result of desugaring a Result.try from `?` syntax
/// e.g. Dict.get? items "key" becomes Result.try (Dict.get items "key") \item -> ...
QuestionSuffix,
/// This call is a result of lowering a reference to a module-params-extended def
NakedParamsVar,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]