argotorg / argotorg/solidity

Error message "Internal or recursive type is not allowed for public state variables" causes confusion

Open
#15,583 4 comments 0 reactions 0 assignees View on GitHub
bug :bug: low effort low impact must have eventually should report better error
Dominant language
C++
Stars
25.7k
Forks
6.2k
Avg merge
2d 19h
Merged PRs (30d)
29

Description

## Description

The following code snippet causes an error with message `recursive type is not allowed for public state variables`. I cannot find references to "recursive type" in the doc https://docs.soliditylang.org/en/latest/types.html. Can we improve the doc or the error message

```solidity
contract contract0 {
struct struct1 {
mapping(int64 => int64)[10] array2;
}
mapping(int64 => struct1) public mapping11;
}
```
## Environment

- Compiler version: 0.8.29

Contributor guide

Open the contributing guide

Research direction

Start with the minimal Solidity snippet in the issue and reproduce the compiler diagnostic using Solidity 0.8.29. Trace where the message "recursive type is not allowed for public state variables" is produced, then determine whether the documentation at docs.soliditylang.org/en/latest/types.html or the diagnostic should explain the restriction. Done means the restriction is clearly documented or the error message is made understandable.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.