Skip to content

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

Open
@haoyang9804

Description

@haoyang9804

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

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

Environment

  • Compiler version: 0.8.29

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.low impactChanges are not very noticeable or potential benefits are limited.must have eventuallySomething we consider essential but not enough to prevent us from releasing Solidity 1.0 without it.should report better errorError is just badly reported. Should be a proper type error - source is not fine.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions