18 lines
442 B
Plaintext
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; }
|