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
@@ -0,0 +1,38 @@
{
"schema": "ailang/v0",
"name": "test_22b2_overriding_nonexistent",
"imports": [],
"defs": [
{
"kind": "class",
"name": "Eq",
"param": "a",
"methods": [
{
"name": "eq",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }, { "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Bool" },
"effects": []
}
}
]
},
{
"kind": "instance",
"class": "Eq",
"type": { "k": "con", "name": "Int" },
"methods": [
{
"name": "eq",
"body": { "t": "lit", "lit": { "kind": "bool", "value": true } }
},
{
"name": "ne",
"body": { "t": "lit", "lit": { "kind": "bool", "value": false } }
}
]
}
]
}