iter ctt.2: Registry.type_def_module re-key to (owning_module, bare_name)

This commit is contained in:
2026-05-12 22:23:46 +02:00
parent 548ebf8d51
commit 9d01d0884c
10 changed files with 385 additions and 40 deletions
+23
View File
@@ -0,0 +1,23 @@
{
"schema": "ailang/v0",
"name": "ctt2_collision_cls",
"imports": [],
"defs": [
{
"kind": "class",
"name": "MyC",
"param": "a",
"methods": [
{
"name": "op",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Int" },
"effects": []
}
}
]
}
]
}
+29
View File
@@ -0,0 +1,29 @@
{
"schema": "ailang/v0",
"name": "ctt2_collision_lib",
"imports": [{ "module": "ctt2_collision_cls" }],
"defs": [
{
"kind": "type",
"name": "Foo",
"ctors": [{ "name": "MkLib", "fields": [] }]
},
{
"kind": "instance",
"class": "MyC",
"type": { "k": "con", "name": "Foo" },
"methods": [
{
"name": "op",
"body": {
"t": "lam",
"params": ["_x"],
"paramTypes": [{ "k": "con", "name": "Foo" }],
"retType": { "k": "con", "name": "Int" },
"body": { "t": "lit", "lit": { "kind": "int", "value": 2 } }
}
}
]
}
]
}
+32
View File
@@ -0,0 +1,32 @@
{
"schema": "ailang/v0",
"name": "ctt2_collision_main",
"imports": [
{ "module": "ctt2_collision_cls" },
{ "module": "ctt2_collision_lib" }
],
"defs": [
{
"kind": "type",
"name": "Foo",
"ctors": [{ "name": "MkMain", "fields": [] }]
},
{
"kind": "instance",
"class": "MyC",
"type": { "k": "con", "name": "Foo" },
"methods": [
{
"name": "op",
"body": {
"t": "lam",
"params": ["_x"],
"paramTypes": [{ "k": "con", "name": "Foo" }],
"retType": { "k": "con", "name": "Int" },
"body": { "t": "lit", "lit": { "kind": "int", "value": 1 } }
}
}
]
}
]
}