test: red for mono-pass unknown module prefix on qualified xmod reference in class workspace

This commit is contained in:
2026-05-10 01:19:45 +02:00
parent ca8ffe8dc3
commit 2bf827f600
3 changed files with 178 additions and 0 deletions
@@ -0,0 +1,59 @@
{
"schema": "ailang/v0",
"name": "test_mono_imports_classmod",
"imports": [],
"defs": [
{
"kind": "class",
"name": "Foo",
"param": "a",
"methods": [
{
"name": "foo",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Int" },
"effects": []
}
}
]
},
{
"kind": "instance",
"class": "Foo",
"type": { "k": "con", "name": "Int" },
"methods": [
{
"name": "foo",
"body": {
"t": "lam",
"params": ["x"],
"paramTypes": [{ "k": "var", "name": "a" }],
"retType": { "k": "con", "name": "Int" },
"body": { "t": "var", "name": "x" }
}
}
]
},
{
"kind": "fn",
"name": "helper",
"type": {
"k": "fn",
"params": [{ "k": "con", "name": "Int" }],
"ret": { "k": "con", "name": "Int" },
"effects": []
},
"params": ["n"],
"body": {
"t": "app",
"fn": { "t": "var", "name": "+" },
"args": [
{ "t": "var", "name": "n" },
{ "t": "lit", "lit": { "kind": "int", "value": 100 } }
]
}
}
]
}
+29
View File
@@ -0,0 +1,29 @@
{
"schema": "ailang/v0",
"name": "test_mono_imports_main",
"imports": [{ "module": "test_mono_imports_classmod" }],
"defs": [
{
"kind": "fn",
"name": "main",
"type": {
"k": "fn",
"params": [],
"ret": { "k": "con", "name": "Unit" },
"effects": ["IO"]
},
"params": [],
"body": {
"t": "do",
"op": "io/print_int",
"args": [
{
"t": "app",
"fn": { "t": "var", "name": "test_mono_imports_classmod.helper" },
"args": [{ "t": "lit", "lit": { "kind": "int", "value": 42 } }]
}
]
}
}
]
}