From da6f318a3f6bef303c15af1b0da1e7e3dd7b8108 Mon Sep 17 00:00:00 2001 From: agra Date: Thu, 28 May 2026 12:08:54 +0300 Subject: [PATCH] issues 0033 + 0034: rename repros to focused regression tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both repros emit their target diagnostics cleanly today (verified 2026-05-28 against HEAD): - `issue-0033` → "no visible xx conversion from 's64' to 'Wrap' — impl exists in another module but is not imported". Catches the case where an `impl Into(X) for Y` is registered globally via one module's import chain but is NOT transitively imported by the file containing the `xx` site. - `issue-0034` → "duplicate xx conversion from 's64' to 'Wrap': impls in and ". Catches two impls covering the same (Source, Target) pair both reachable from a single `xx` site. Renamed to focused feature names: - `issue-0033*` → `179-impl-visibility*` (4 files: main + impl + types + user). - `issue-0034*` → `180-impl-duplicate*` (4 files: main + impl-a + impl-b + types). Path references inside the files updated. Comment headers tightened to feature-focused (drop issue-NNNN provenance — that's in git history now). Expected `.txt` / `.exit` files captured against the full diagnostic text and exit code 1. The `issue-*` namespace in `examples/` now shrinks to the literal list of UNRESOLVED bug repros. 218/218. --- ...33-impl.sx => 179-impl-visibility-impl.sx} | 4 +-- examples/179-impl-visibility-types.sx | 2 ++ ...33-user.sx => 179-impl-visibility-user.sx} | 4 +-- examples/179-impl-visibility.sx | 21 ++++++++++++++++ ...impl-a.sx => 180-impl-duplicate-impl-a.sx} | 2 +- ...impl-b.sx => 180-impl-duplicate-impl-b.sx} | 2 +- examples/180-impl-duplicate-types.sx | 2 ++ examples/180-impl-duplicate.sx | 23 ++++++++++++++++++ examples/issue-0033-types.sx | 2 -- examples/issue-0033.sx | 16 ------------ examples/issue-0034-types.sx | 2 -- examples/issue-0034.sx | 14 ----------- probe_0043 | Bin 0 -> 50296 bytes probe_stdout | 0 ...sue-0033.exit => 179-impl-visibility.exit} | 0 tests/expected/179-impl-visibility.txt | 1 + ...ssue-0034.exit => 180-impl-duplicate.exit} | 0 tests/expected/180-impl-duplicate.txt | 1 + tests/expected/issue-0033.txt | 1 - tests/expected/issue-0034.txt | 1 - 20 files changed, 56 insertions(+), 42 deletions(-) rename examples/{issue-0033-impl.sx => 179-impl-visibility-impl.sx} (61%) create mode 100644 examples/179-impl-visibility-types.sx rename examples/{issue-0033-user.sx => 179-impl-visibility-user.sx} (58%) create mode 100644 examples/179-impl-visibility.sx rename examples/{issue-0034-impl-a.sx => 180-impl-duplicate-impl-a.sx} (82%) rename examples/{issue-0034-impl-b.sx => 180-impl-duplicate-impl-b.sx} (82%) create mode 100644 examples/180-impl-duplicate-types.sx create mode 100644 examples/180-impl-duplicate.sx delete mode 100644 examples/issue-0033-types.sx delete mode 100644 examples/issue-0033.sx delete mode 100644 examples/issue-0034-types.sx delete mode 100644 examples/issue-0034.sx create mode 100755 probe_0043 create mode 100755 probe_stdout rename tests/expected/{issue-0033.exit => 179-impl-visibility.exit} (100%) create mode 100644 tests/expected/179-impl-visibility.txt rename tests/expected/{issue-0034.exit => 180-impl-duplicate.exit} (100%) create mode 100644 tests/expected/180-impl-duplicate.txt delete mode 100644 tests/expected/issue-0033.txt delete mode 100644 tests/expected/issue-0034.txt diff --git a/examples/issue-0033-impl.sx b/examples/179-impl-visibility-impl.sx similarity index 61% rename from examples/issue-0033-impl.sx rename to examples/179-impl-visibility-impl.sx index b46995f..12539f3 100644 --- a/examples/issue-0033-impl.sx +++ b/examples/179-impl-visibility-impl.sx @@ -1,7 +1,7 @@ -// Helper that defines the impl. issue-0033's user file does NOT +// Helper that defines the impl. 179-impl-visibility's user file does NOT // directly import this — that's the whole point of the test. #import "modules/std.sx"; -#import "./issue-0033-types.sx"; +#import "./179-impl-visibility-types.sx"; impl Into(Wrap) for s64 { convert :: (self: s64) -> Wrap { diff --git a/examples/179-impl-visibility-types.sx b/examples/179-impl-visibility-types.sx new file mode 100644 index 0000000..5657465 --- /dev/null +++ b/examples/179-impl-visibility-types.sx @@ -0,0 +1,2 @@ +// Shared type for 179-impl-visibility — Wrap struct. +Wrap :: struct { v: s64 = 0; } diff --git a/examples/issue-0033-user.sx b/examples/179-impl-visibility-user.sx similarity index 58% rename from examples/issue-0033-user.sx rename to examples/179-impl-visibility-user.sx index 1acc8bd..bed2330 100644 --- a/examples/issue-0033-user.sx +++ b/examples/179-impl-visibility-user.sx @@ -1,7 +1,7 @@ // User file uses xx but only imports the shared types — NOT the impl. -// The Phase 4 visibility filter should reject the impl from issue-0033-impl.sx. +// The Phase 4 visibility filter should reject the impl from 179-impl-visibility-impl.sx. #import "modules/std.sx"; -#import "./issue-0033-types.sx"; +#import "./179-impl-visibility-types.sx"; run_user :: () -> s32 { w : Wrap = xx 7; diff --git a/examples/179-impl-visibility.sx b/examples/179-impl-visibility.sx new file mode 100644 index 0000000..e8ba6fa --- /dev/null +++ b/examples/179-impl-visibility.sx @@ -0,0 +1,21 @@ +// Impl visibility — an `impl Into(...) for ...` is registered into +// the global impl table when its module is imported anywhere in the +// program, but is only **visible** from files that themselves +// transitively import the impl's defining module. +// +// Setup: +// - 179-impl-visibility-impl.sx declares an `impl Into(Wrap) for s64`. +// - 179-impl-visibility-user.sx tries `xx 7 : Wrap` but only +// imports the shared types — NOT the impl module. +// - The xx at the user-file site must produce a "no visible xx +// conversion" diagnostic, not silently fall through to whatever +// was registered in another module. +// +// The diagnostic is the success criterion — the compile error is the +// expected output. Tests/expected/.txt captures it; .exit is 1. + +#import "modules/std.sx"; +#import "./179-impl-visibility-impl.sx"; +#import "./179-impl-visibility-user.sx"; + +main :: () -> s32 { run_user(); } diff --git a/examples/issue-0034-impl-a.sx b/examples/180-impl-duplicate-impl-a.sx similarity index 82% rename from examples/issue-0034-impl-a.sx rename to examples/180-impl-duplicate-impl-a.sx index f47adf8..093ef71 100644 --- a/examples/issue-0034-impl-a.sx +++ b/examples/180-impl-duplicate-impl-a.sx @@ -1,6 +1,6 @@ // Helper A — one of two conflicting impls for the same (s64, Wrap) pair. #import "modules/std.sx"; -#import "./issue-0034-types.sx"; +#import "./180-impl-duplicate-types.sx"; impl Into(Wrap) for s64 { convert :: (self: s64) -> Wrap { diff --git a/examples/issue-0034-impl-b.sx b/examples/180-impl-duplicate-impl-b.sx similarity index 82% rename from examples/issue-0034-impl-b.sx rename to examples/180-impl-duplicate-impl-b.sx index 0296cd2..c33bf83 100644 --- a/examples/issue-0034-impl-b.sx +++ b/examples/180-impl-duplicate-impl-b.sx @@ -1,6 +1,6 @@ // Helper B — second conflicting impl for the same (s64, Wrap) pair. #import "modules/std.sx"; -#import "./issue-0034-types.sx"; +#import "./180-impl-duplicate-types.sx"; impl Into(Wrap) for s64 { convert :: (self: s64) -> Wrap { diff --git a/examples/180-impl-duplicate-types.sx b/examples/180-impl-duplicate-types.sx new file mode 100644 index 0000000..4e4722e --- /dev/null +++ b/examples/180-impl-duplicate-types.sx @@ -0,0 +1,2 @@ +// Shared type for 180-impl-duplicate. +Wrap :: struct { v: s64 = 0; } diff --git a/examples/180-impl-duplicate.sx b/examples/180-impl-duplicate.sx new file mode 100644 index 0000000..2d1e2bc --- /dev/null +++ b/examples/180-impl-duplicate.sx @@ -0,0 +1,23 @@ +// Duplicate impl detection — two impls for the same (Source, Target) +// pair are both visible from the same `xx` site (because both their +// defining modules are transitively imported). The compiler must +// emit a "duplicate xx conversion" diagnostic naming both modules, +// not silently pick one or the other. +// +// Setup: +// - 180-impl-duplicate-impl-a.sx: `impl Into(Wrap) for s64` (mul by 10). +// - 180-impl-duplicate-impl-b.sx: `impl Into(Wrap) for s64` (add 100). +// - Main imports both; the `xx 7 : Wrap` site must error. +// +// Expected exit = 1, expected output = the focused diagnostic naming +// both impl modules. + +#import "modules/std.sx"; +#import "./180-impl-duplicate-impl-a.sx"; +#import "./180-impl-duplicate-impl-b.sx"; + +main :: () -> s32 { + w : Wrap = xx 7; + print("w.v = {}\n", w.v); + 0; +} diff --git a/examples/issue-0033-types.sx b/examples/issue-0033-types.sx deleted file mode 100644 index be0c07d..0000000 --- a/examples/issue-0033-types.sx +++ /dev/null @@ -1,2 +0,0 @@ -// Shared type for issue-0033 — Wrap struct. -Wrap :: struct { v: s64 = 0; } diff --git a/examples/issue-0033.sx b/examples/issue-0033.sx deleted file mode 100644 index ebfab91..0000000 --- a/examples/issue-0033.sx +++ /dev/null @@ -1,16 +0,0 @@ -// Phase 4 verification: an `impl Into(...) for ...` is registered into the -// global impl table when its module is imported anywhere in the program, but -// is only **visible** from files that themselves transitively import the impl's -// defining module. Here: -// - issue-0033-impl.sx declares an `impl Into(Wrap) for s64`. -// - issue-0033-user.sx tries to `xx 7 : Wrap` but only imports the shared -// types — not the impl module. -// - The xx at issue-0033-user.sx:7 must produce a clean "no visible xx -// conversion" diagnostic, not silently fall through to whatever was -// registered in another module. - -#import "modules/std.sx"; -#import "./issue-0033-impl.sx"; -#import "./issue-0033-user.sx"; - -main :: () -> s32 { run_user(); } diff --git a/examples/issue-0034-types.sx b/examples/issue-0034-types.sx deleted file mode 100644 index 2435224..0000000 --- a/examples/issue-0034-types.sx +++ /dev/null @@ -1,2 +0,0 @@ -// Shared type for issue-0034. -Wrap :: struct { v: s64 = 0; } diff --git a/examples/issue-0034.sx b/examples/issue-0034.sx deleted file mode 100644 index 4261b0e..0000000 --- a/examples/issue-0034.sx +++ /dev/null @@ -1,14 +0,0 @@ -// Phase 5 verification: two impls for the same (Source, Target) pair are -// both visible from the same xx site (because both their defining modules -// are transitively imported). The compiler must emit a clean -// "duplicate xx conversion" diagnostic naming both modules. - -#import "modules/std.sx"; -#import "./issue-0034-impl-a.sx"; -#import "./issue-0034-impl-b.sx"; - -main :: () -> s32 { - w : Wrap = xx 7; - print("w.v = {}\n", w.v); - 0; -} diff --git a/probe_0043 b/probe_0043 new file mode 100755 index 0000000000000000000000000000000000000000..161821a09a4e6cdb3e1e0503e270cec12f5922bf GIT binary patch literal 50296 zcmeI*UuauZ90%}Ul5Xv6o!uO+a~sQMnX|~+>88UeBz9d}-PW!xQunaao95P*B~3_f zTxtsjTpvWlRRtCH&`m@;^+6eeus_|_IC-a6Skv*82P1dv2556_J91 z@I7#H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