Validate method substitution before definition updates and execution

This commit is contained in:
2026-10-22 14:13:46 +08:00
parent 6b4cce1fee
commit e26e227dd0
14 changed files with 803 additions and 14 deletions
+10
View File
@@ -18,6 +18,11 @@ pub enum VmError {
method: String,
reason: &'static str,
},
OverrideViolation {
definition: String,
method: String,
reason: &'static str,
},
UnknownAnnotation(String),
TypeMismatch {
function: String,
@@ -63,6 +68,11 @@ impl fmt::Display for VmError {
Self::UnknownAnnotation(name) => {
write!(f, "unknown or invalid type annotation: {name}")
}
Self::OverrideViolation {
definition,
method,
reason,
} => write!(f, "override {definition}.{method}: {reason}"),
Self::TypeMismatch {
function,
position,