7289bbc9d4
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.
39 lines
844 B
JSON
39 lines
844 B
JSON
{
|
|
"schema": "ailang/v0",
|
|
"name": "test_22b2_overriding_nonexistent",
|
|
"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": "instance",
|
|
"class": "TEq",
|
|
"type": { "k": "con", "name": "Int" },
|
|
"methods": [
|
|
{
|
|
"name": "teq",
|
|
"body": { "t": "lit", "lit": { "kind": "bool", "value": true } }
|
|
},
|
|
{
|
|
"name": "ne",
|
|
"body": { "t": "lit", "lit": { "kind": "bool", "value": false } }
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|