iter 22b.3.5: fix — quality-review (chained-call test, hoist class_index, drop noise comments)

This commit is contained in:
2026-05-09 20:59:43 +02:00
parent dd87b36e00
commit e8018d48b6
3 changed files with 126 additions and 7 deletions
+73
View File
@@ -0,0 +1,73 @@
{
"schema": "ailang/v0",
"name": "test_22b3_chained_calls",
"imports": [],
"defs": [
{
"kind": "class", "name": "B", "param": "a",
"methods": [{
"name": "b_method",
"type": {
"k": "fn", "params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Int" }, "effects": []
}
}]
},
{
"kind": "class", "name": "A", "param": "a",
"methods": [{
"name": "a_method",
"type": {
"k": "fn", "params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Int" }, "effects": []
},
"default": {
"t": "lam",
"params": ["x"],
"paramTypes": [{ "k": "var", "name": "a" }],
"retType": { "k": "con", "name": "Int" },
"body": {
"t": "app",
"fn": { "t": "var", "name": "b_method" },
"args": [{ "t": "var", "name": "x" }]
}
}
}]
},
{
"kind": "instance",
"class": "B",
"type": { "k": "con", "name": "Int" },
"methods": [{
"name": "b_method",
"body": {
"t": "lam",
"params": ["y"],
"paramTypes": [{ "k": "var", "name": "a" }],
"retType": { "k": "con", "name": "Int" },
"body": { "t": "var", "name": "y" }
}
}]
},
{
"kind": "instance",
"class": "A",
"type": { "k": "con", "name": "Int" },
"methods": []
},
{
"kind": "fn",
"name": "main",
"type": {
"k": "fn", "params": [], "ret": { "k": "con", "name": "Int" },
"effects": []
},
"params": [],
"body": {
"t": "app",
"fn": { "t": "var", "name": "a_method" },
"args": [{ "t": "lit", "lit": { "kind": "int", "value": 5 } }]
}
}
]
}