iter 22b.2.5: overriding-non-existent-method diagnostic

This commit is contained in:
2026-05-09 17:59:10 +02:00
parent 257b47625d
commit 634bd5eca3
3 changed files with 111 additions and 0 deletions
+17
View File
@@ -1029,6 +1029,23 @@ fn workspace_error_to_diagnostic(
"method": method,
})),
),
W::OverridingNonExistentMethod {
class,
type_repr,
method,
} => Some(
ailang_check::Diagnostic::error(
"overriding-non-existent-method",
format!(
"instance `{class} {type_repr}` provides body for method `{method}`, but class `{class}` does not declare it"
),
)
.with_ctx(serde_json::json!({
"class": class,
"type": type_repr,
"method": method,
})),
),
W::KindMismatch {
class,
param,