feat: support decorator

This commit is contained in:
Shunsuke Shibayama 2023-09-16 16:29:14 +09:00
parent 5497af5626
commit 9db9348dc5
8 changed files with 118 additions and 9 deletions

View file

@ -120,6 +120,13 @@ pub(crate) fn inheritable_func(mut args: ValueArgs, _ctx: &Context) -> EvalValue
}
}
pub(crate) fn override_func(mut args: ValueArgs, _ctx: &Context) -> EvalValueResult<TyParam> {
let func = args
.remove_left_or_key("func")
.ok_or_else(|| not_passed("func"))?;
Ok(func.into())
}
/// Base: Type, Impl := Type -> TraitType
pub(crate) fn trait_func(mut args: ValueArgs, ctx: &Context) -> EvalValueResult<TyParam> {
let req = args