iter 22b.2.8: register class methods in module globals

This commit is contained in:
2026-05-09 18:33:01 +02:00
parent 6869bd5d0c
commit 17605a3327
3 changed files with 223 additions and 26 deletions
@@ -0,0 +1,34 @@
{
"schema": "ailang/v0",
"name": "test_22b2_class_method_lookup",
"imports": [],
"defs": [
{
"kind": "class",
"name": "Show",
"param": "a",
"methods": [
{
"name": "show",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Str" },
"effects": []
}
}
]
},
{
"kind": "instance",
"class": "Show",
"type": { "k": "con", "name": "Int" },
"methods": [
{
"name": "show",
"body": { "t": "lit", "lit": { "kind": "str", "value": "n" } }
}
]
}
]
}