Skip to content

ICE for emit statement with argument of function type #16298

@alex2449

Description

@alex2449

Description

The following code triggers an ICE when compiling with --ir. I think the issue comes from passing a function type that is not identical but implicitly convertible to an indexed event parameter.

Steps to Reproduce

testcase.sol

// SPDX-License-Identifier: GPL-3.0

pragma solidity =0.8.30;

contract C {
    event W(function () external view indexed p);

    function f(function () external pure p) public {
        emit W(p);
    }
}

solc --ir testcase.sol

Internal compiler error:
/solidity/libsolidity/codegen/ir/IRGeneratorForStatements.cpp(1093): Throw in function virtual void solidity::frontend::IRGeneratorForStatements::endVisit(const solidity::frontend::FunctionCall&)
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

Environment

  • Compiler version: 0.8.30

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