Files
c3c/test/test_suite/methods/ambiguous_equals.c3
Christoffer Lerno 07bd37da43 Further #2226 fixes.
2025-06-21 16:50:52 +02:00

14 lines
340 B
Plaintext

import std;
struct Word {int x;}
typedef Byte = inline ushort;
macro bool Word.add0(self, int other) @operator(==) => self.x == (int)other;
macro bool Word.add2(self, long other) @operator(==) => self.x == (int)other;
fn int main()
{
Word a = {1};
Byte b = 2;
bool c = a == b; // #error: has more than one candidate method
return 0;
}