Skip to content

ICE when emitting an event via module member access #16314

@mudgen

Description

@mudgen

Description

This code:

// SPDX-License-Identifier: MIT

pragma solidity =0.8.29;

import * as Test2 from "./test2.sol";

contract A {

    function returnAddress() external {
        emit Test2.Transfer(address(0), address(0), 14);        
    }
}

Produces this error:

Internal compiler error:
/solidity/libsolidity/codegen/ExpressionCompiler.cpp(2139): Throw in function virtual bool solidity::frontend::ExpressionCompiler::visit(const MemberAccess &)
Dynamic exception type: boost::wrapexcept<solidity::langutil::InternalCompilerError>
std::exception::what: Solidity assertion failed
[solidity::util::tag_comment*] = Solidity assertion failed

This is the contents of test2.sol:

// SPDX-License-Identifier: MIT
pragma solidity =0.8.29;

event Transfer(address indexed _from, address indexed _to, uint256 _value);

I would really like this to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛low effortThere is not much implementation work to be done. The task is very easy or tiny.medium impactDefault level of impactmust haveSomething we consider an essential part of Solidity 1.0.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions