Files
sx/examples/issue-0056/common.sx
agra 29a4891374 imports: dedup flat decl list by node identity (issue 0056 FIXED)
Impl blocks are anonymous (no declName), so a parameterised-protocol impl in a module reached via a diamond import was appended once per path and registered twice — 'duplicate impl Into for source s64'. mergeFlat and the directory-import merge loop now also dedup by node pointer; a physical AST node is lowered once regardless of how many import paths reach it.

Regression: examples/issue-0056-diamond-param-impl.sx.
2026-05-30 17:36:35 +03:00

13 lines
516 B
Plaintext

// A parameterised-protocol (`Into`) impl living in a module reachable through
// more than one import path. Each path must NOT re-register the impl.
// Impl blocks are anonymous (`declName() == null`), so the diamond-import
// dedup in imports.zig (`mergeFlat`) skips them and appends the node once per
// path — `registerParamImpl` then trips its same-file duplicate check.
Wrapped :: struct { v: s64; }
impl Into(Wrapped) for s64 {
convert :: (self: s64) -> Wrapped {
return .{ v = self };
}
}