Files
AILang/examples/test_22b2_missing_superclass_instance.ail.json
T
Brummel 7289bbc9d4 iter 23.2.3-prep: reconcile workspace tests with auto-loaded prelude class Eq
The auto-loaded prelude (iter 23.2 work-in-progress) injects
`class Eq` plus three primitive instances (Eq Int, Eq Bool, Eq Str)
into every workspace. Five workspace::tests assertions broke against
this new baseline:

- iter22b1_missing_method_fires_diagnostic
- instance_without_superclass_instance_fires
- instance_overriding_nonexistent_method_fires
  Their fixtures redeclare `class Eq` (and `class Ord` in one case),
  which now collides with the prelude. Renamed each fixture's
  `Eq`/`eq` -> `TEq`/`teq` and `Ord`/`lt` -> `TOrd`/`tlt`, matching
  the scheme already used in the two earlier-renamed test_22b2
  fixtures. Method `ne` stays (does not collide). Assertion strings
  in workspace.rs updated to match.

- iter22b1_workspace_with_no_classes_has_empty_registry
- iter22b1_instance_in_class_module_loads_clean
  Their asserted registry counts assumed an otherwise-empty registry.
  Rewritten to filter by `defining_module != "prelude"`: the property
  is "no NON-prelude entries" / "exactly one fixture-owned entry",
  not raw count.

Doc comments updated alongside each assertion change so the rationale
for TEq/TOrd (collision avoidance) is local. No production code
touched.
2026-05-10 22:34:30 +02:00

40 lines
1016 B
JSON

{
"schema": "ailang/v0",
"name": "test_22b2_missing_superclass_instance",
"imports": [],
"defs": [
{
"kind": "class", "name": "TEq", "param": "a",
"methods": [{
"name": "teq",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }, { "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Bool" }, "effects": []
}
}]
},
{
"kind": "class", "name": "TOrd", "param": "a",
"superclass": { "class": "TEq", "type": "a" },
"methods": [{
"name": "tlt",
"type": {
"k": "fn",
"params": [{ "k": "var", "name": "a" }, { "k": "var", "name": "a" }],
"ret": { "k": "con", "name": "Bool" }, "effects": []
}
}]
},
{
"kind": "instance",
"class": "TOrd",
"type": { "k": "con", "name": "Int" },
"methods": [{
"name": "tlt",
"body": { "t": "lit", "lit": { "kind": "bool", "value": true } }
}]
}
]
}