Skip to content

ICE in StructType::isDynamicallyEncoded when a struct member is a function type with a calldata return #16622

@jubnzv

Description

@jubnzv

The compiler panics with Solidity assertion failed in libsolidity/ast/Types.cpp:2295 inside StructType::isDynamicallyEncoded() when a struct contains a function-type member whose return type carries calldata data location.

MRE:

contract C { struct S { function() returns (S[2] calldata) a; } }

Reproduce: save as mre.sol, run solc --bin mre.sol.

Output:

Internal compiler error:
/solidity/libsolidity/ast/Types.cpp(2295): Throw in function virtual bool solidity::frontend::StructType::isDynamicallyEncoded() const
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Expected behavior: a type error explaining that calldata is not a valid data location for a function-type return value, or that such a type cannot be used as a struct member.

Git commit: 9be6619
solc 0.8.35-develop.2026.4.18+commit.9be66192.Linux.g++

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions