mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Tests.
This commit is contained in:
parent
46f3da0b87
commit
c54814b47b
7
test/libsolidity/syntaxTests/getter/complex_struct.sol
Normal file
7
test/libsolidity/syntaxTests/getter/complex_struct.sol
Normal file
@ -0,0 +1,7 @@
|
||||
contract C {
|
||||
struct Y {
|
||||
uint a;
|
||||
uint b;
|
||||
}
|
||||
mapping(uint256 => Y) public m;
|
||||
}
|
11
test/libsolidity/syntaxTests/getter/nested_structs.sol
Normal file
11
test/libsolidity/syntaxTests/getter/nested_structs.sol
Normal file
@ -0,0 +1,11 @@
|
||||
contract C {
|
||||
struct Y {
|
||||
uint b;
|
||||
}
|
||||
struct X {
|
||||
Y a;
|
||||
}
|
||||
mapping(uint256 => X) public m;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (88-118): The following types are only supported for getters in the new experimental ABI encoder: struct C.Y memory. Either remove "public" or use "pragma experimental ABIEncoderV2;" to enable the feature.
|
8
test/libsolidity/syntaxTests/getter/recursive_struct.sol
Normal file
8
test/libsolidity/syntaxTests/getter/recursive_struct.sol
Normal file
@ -0,0 +1,8 @@
|
||||
contract C {
|
||||
struct Y {
|
||||
Y[] x;
|
||||
}
|
||||
mapping(uint256 => Y) public m;
|
||||
}
|
||||
// ----
|
||||
// TypeError: (53-83): Internal or recursive type is not allowed for public state variables.
|
6
test/libsolidity/syntaxTests/getter/simple_struct.sol
Normal file
6
test/libsolidity/syntaxTests/getter/simple_struct.sol
Normal file
@ -0,0 +1,6 @@
|
||||
contract C {
|
||||
struct Y {
|
||||
uint b;
|
||||
}
|
||||
mapping(uint256 => Y) public m;
|
||||
}
|
Loading…
Reference in New Issue
Block a user