Handle not unique operators for user-defined type.

This commit is contained in:
wechman
2022-09-28 12:10:27 +02:00
parent 8272da0aea
commit 8307b670cb
4 changed files with 35 additions and 16 deletions
@@ -0,0 +1,17 @@
type Int is uint128;
using {add as +, sub as +} for Int;
function add(Int, Int) returns (Int) {
return Int.wrap(0);
}
function sub(Int, Int) returns (Int) {
return Int.wrap(0);
}
function test() {
Int.wrap(0) + Int.wrap(1);
}
// ----
// TypeError 2271: (213-238): Operator + not compatible with types Int and Int. A user-defined operator not unique.