mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update multiple_custom_operators_same_contract
This commit is contained in:
parent
cf82accb14
commit
dd251379e7
@ -1,16 +1,18 @@
|
|||||||
|
// TODO: Isn't it suppose to be the exact same as all_operators.sol ?
|
||||||
|
|
||||||
type MyInt is int;
|
type MyInt is int;
|
||||||
using {add as +} for MyInt;
|
using {add as +} for MyInt;
|
||||||
|
|
||||||
function add(MyInt, MyInt) pure returns (bool) {
|
function add(MyInt, MyInt) pure returns (MyInt) {
|
||||||
return true;
|
return MyInt.wrap(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
contract C {
|
contract C {
|
||||||
function f() public pure returns (bool t) {
|
function f() public pure returns (MyInt t) {
|
||||||
t = MyInt.wrap(2) + MyInt.wrap(7);
|
t = MyInt.wrap(2) + MyInt.wrap(7);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ====
|
// ====
|
||||||
// compileViaYul: also
|
// compileViaYul: also
|
||||||
// ----
|
// ----
|
||||||
// f() -> true
|
// f() -> 0
|
||||||
|
Loading…
Reference in New Issue
Block a user