mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
[SMTChecker] Support type(I).interfaceId
This commit is contained in:
@@ -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.
|
||||
Reference in New Issue
Block a user