mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add nested structs semantic tests for type(S).typehash
This commit is contained in:
parent
b65751c030
commit
bcadf3c5de
@ -0,0 +1,28 @@
|
||||
contract C {
|
||||
struct S2 {
|
||||
uint256 x;
|
||||
S1 y;
|
||||
}
|
||||
|
||||
struct S1 {
|
||||
uint256 z;
|
||||
S3[] w;
|
||||
}
|
||||
|
||||
struct S3 {
|
||||
address a;
|
||||
uint24 b;
|
||||
}
|
||||
|
||||
function f() public pure returns(bool, bool, bool) {
|
||||
return (
|
||||
type(S3).typehash == keccak256("S3(address a,uint24 b)"),
|
||||
type(S1).typehash == keccak256("S1(uint256 z,S3[] w)S3(address a,uint24 b)"),
|
||||
type(S2).typehash == keccak256("S2(uint256 x,S1 y)S1(uint256 z,S3[] w)S3(address a,uint24 b)")
|
||||
);
|
||||
}
|
||||
}
|
||||
// ====
|
||||
// compileToEwasm: also
|
||||
// ----
|
||||
// f() -> true, true, true
|
Loading…
Reference in New Issue
Block a user