Open
Description
Description
The compiler refuses to generate a getter for a struct if omitting all dynamic array and/or mapping fields would leave it empty. There's however a case where this happens even if the outer struct would not actually be empty. That's the case when the fields are omitted only in a nested struct. Currently the compiler reports this as an error but I think that in this case it should just omit the whole nested struct instead.
Steps to Reproduce
contract C {
struct T { mapping(uint => uint) m; }
struct S { uint i; T t; }
S public x;
}
Error: Internal or recursive type is not allowed for public state variables.
--> test.sol:4:5:
|
4 | S public x;
| ^^^^^^^^^^
Environment
- Compiler version: 0.8.10