[SMTChecker] Support type(I).interfaceId

This commit is contained in:
Alex Beregszaszi
2020-09-14 20:34:52 +01:00
parent 552a5f0913
commit 83934254ea
3 changed files with 42 additions and 1 deletions
@@ -0,0 +1,32 @@
pragma experimental SMTChecker;
interface I1 {
}
interface I2 {
function f() external;
}
interface I3 {
function f() external;
function g(uint, address) external;
}
contract C {
function f() public pure {
assert(type(I1).interfaceId == 0);
assert(type(I2).interfaceId != 0);
assert(type(I2).interfaceId == 0x26121ff0);
assert(type(I2).interfaceId != 0);
assert(type(I3).interfaceId == 0x822b51c6);
}
function g() public pure {
assert(type(I1).interfaceId == type(I2).interfaceId);
}
function h() public pure {
assert(type(I2).interfaceId == type(I3).interfaceId);
}
}
// ----
// Warning 6328: (449-501): Assertion violation happens here.
// Warning 6328: (536-588): Assertion violation happens here.