mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
"Operator has not been user-defined." is displayed only is operator can be user-defined
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user