Add explicit managed traits and inherited method arity contracts

This commit is contained in:
2026-10-21 21:34:46 +08:00
parent b7daabdaad
commit eb60212428
16 changed files with 454 additions and 16 deletions
+2 -2
View File
@@ -443,7 +443,7 @@ impl Vm {
};
let fields = self
.dict_items(fields)?
.into_iter()
.iter()
.map(|(name, type_name)| match (name, type_name) {
(Value::Text(name), Value::Text(type_name)) => Ok(crate::ClassField {
name: name.clone(),
@@ -454,7 +454,7 @@ impl Vm {
.collect::<Result<Vec<_>, _>>()?;
let methods = self
.dict_items(methods)?
.into_iter()
.iter()
.map(|(name, function)| match (name, function) {
(Value::Text(name), Value::Object(function)) => Ok((name.clone(), *function)),
_ => Err(VmError::ObjectKindMismatch("class method")),