Add explicit managed traits and inherited method arity contracts
This commit is contained in:
@@ -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")),
|
||||
|
||||
Reference in New Issue
Block a user