solidity icon indicating copy to clipboard operation
solidity copied to clipboard

Assigning the selector of a parent function to a constant crashes solc

Open xermicus opened this issue 7 months ago • 0 comments

This Solidity:

contract B {
    function g() public {}
}

contract C is B {
     // the constant keyword triggers the crash
    bytes4 public constant s2 = B.g.selector;
}

crashes the compiler with the following error:

❯ solc --version
solc, the solidity compiler commandline interface
Version: 0.8.30+commit.73712a01.Linux.g++
❯ solc --ir reproducer.sol
Uncaught exception:
Dynamic exception type: std::out_of_range
std::exception::what: map::at

xermicus avatar May 14 '25 13:05 xermicus