"Operator has not been user-defined." is displayed only is operator can be user-defined

This commit is contained in:
wechman
2022-09-28 13:09:15 +02:00
parent 5942912bf1
commit dcce3fa89b
6 changed files with 58 additions and 8 deletions
@@ -0,0 +1,11 @@
type Int is int256;
function f() pure {
Int a = Int.wrap(0);
a + a;
a >>> a;
}
// ----
// TypeError 2271: (70-75): Binary operator + not compatible with types Int and Int. No matching user-defined operator found.
// TypeError 2271: (81-88): Binary operator >>> not compatible with types Int and Int.
@@ -0,0 +1,11 @@
type Int is int256;
function f() pure {
Int a = Int.wrap(0);
-a;
a++;
}
// ----
// TypeError 4907: (70-72): Unary operator - cannot be applied to type Int. No matching user-defined operator found.
// TypeError 9767: (78-81): Unary operator ++ cannot be applied to type Int.