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++
The compiler panics with
Solidity assertion failedinlibsolidity/ast/Types.cpp:2295insideStructType::isDynamicallyEncoded()when a struct contains a function-type member whose return type carriescalldatadata location.MRE:
Reproduce: save as
mre.sol, runsolc --bin mre.sol.Output:
Expected behavior: a type error explaining that
calldatais 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++