Add typed trait requirements and enforce actual capability results

This commit is contained in:
2026-10-22 14:36:57 +08:00
parent e26e227dd0
commit 100bf637f9
16 changed files with 799 additions and 107 deletions
+7
View File
@@ -40,6 +40,13 @@ impl Vm {
) -> Result<ObjectRef, VmError> {
self.objects.new_trait(name, requirements)
}
pub fn new_typed_trait(
&mut self,
name: impl Into<String>,
requirements: Vec<crate::TypedMethodRequirement>,
) -> Result<ObjectRef, VmError> {
self.objects.new_typed_trait(name, requirements)
}
pub fn implement_trait(
&mut self,
definition: ObjectRef,