2019-05-21 12:40:28 +00:00
|
|
|
contract C {
|
|
|
|
function internal1() internal pure returns (bool) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
function internal2() internal pure returns (bool) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-05-22 10:25:00 +00:00
|
|
|
function equal() public pure returns (bool same, bool diff, bool inv) {
|
|
|
|
function() internal pure returns (bool) invalid;
|
|
|
|
delete invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
same = internal1 == internal1;
|
|
|
|
diff = internal1 == internal2;
|
2019-05-22 10:25:00 +00:00
|
|
|
inv = internal1 == invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
}
|
|
|
|
|
2019-05-22 10:25:00 +00:00
|
|
|
function unequal() public pure returns (bool same, bool diff, bool inv) {
|
|
|
|
function() internal pure returns (bool) invalid;
|
|
|
|
delete invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
same = internal1 != internal1;
|
|
|
|
diff = internal1 != internal2;
|
2019-05-22 10:25:00 +00:00
|
|
|
inv = internal1 != invalid;
|
2019-05-21 12:40:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
// ====
|
|
|
|
// compileViaYul: true
|
|
|
|
// ----
|
2019-05-22 10:25:00 +00:00
|
|
|
// equal() -> true, false, false
|
|
|
|
// unequal() -> false, true, true
|