Skip to content

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

Open
@xermicus

Description

@xermicus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @xermicus

      Issue actions

        Assigning the selector of a parent function to a constant crashes solc · Issue #16050 · ethereum/solidity