Files
sx/examples/issue-0032.sx
2026-05-18 17:40:10 +03:00

18 lines
442 B
Plaintext

// Phase 2 verification: two impls for the same parameterised-protocol
// (Source, Target) pair declared in the same file MUST produce a clean
// "duplicate impl" diagnostic at registration time.
#import "modules/std.sx";
MyA :: struct { v: s64 = 0; }
impl Into(MyA) for s64 {
convert :: (self: s64) -> MyA { .{ v = self }; }
}
impl Into(MyA) for s64 {
convert :: (self: s64) -> MyA { .{ v = self * 2 }; }
}
main :: () -> s32 { 0; }