Skip to content

ICE when calling an unimplemented virtual function via super #11445

@prestige-club

Description

@prestige-club

Description

Trying to call super in a contract with multiple inheritance throws an InternalCompilerError with no message.
In my case, it appeared when overriding a function of a parent class and implemented interface and then calling super on that same function.

Environment

  • Compiler version: 0.8.1 (also appears at least on 0.8.4 and 0.6.1)
  • Target EVM version (as per compiler settings): istanbul
  • Framework/IDE (e.g. Truffle or Remix): Both Truffle and Remix show this behaviour
  • EVM execution environment / backend / blockchain client: n.a.
  • Operating system: Win10

Steps to Reproduce

pragma solidity 0.8.1;
// SPDX-License-Identifier: MIT

contract A{
    function x() public virtual {
    }
}

interface I{
    function x() external;
}

contract B is A, I{
    
    function x() override(A, I) public {
        super.x();
    }
    
}

Compiler error occurs when compiling above Source code.
Although using super in this case is definitely not best-practice, I think there should be error message which helps identify the source (searched for 4 hours myself).

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions