solidity icon indicating copy to clipboard operation
solidity copied to clipboard

[ICE]: Setting the selector to public causes an error.

Open Subway2023 opened this issue 8 months ago • 0 comments

solc version: 0.8.29 description: The statement bytes4 public constant s2 = B.g.selector; causes a compilation error, but removing public resolves the issue.

interface A {
    function f() external;
}
contract B {
    function g() public {}
}
contract C is B {
    function h() external {}
    bytes4 constant s1 = A.f.selector;
    bytes4 public constant s2 = B.g.selector;
    bytes4 constant s3 = this.h.selector;
    bytes4 constant s4 = super.g.selector;
}
solc_0829 test.sol --combined-json bin,abi --via-ir --optimize

Uncaught exception:
Dynamic exception type: std::out_of_range
std::exception::what: map::at

Subway2023 avatar Apr 08 '25 14:04 Subway2023