Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function selectors from inherited interfaces are not visible in parent interface #15157

Open
mnusurov opened this issue May 28, 2024 · 1 comment
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. medium impact Default level of impact should compile without error Error is reported even though it shouldn't. Source is fine.

Comments

@mnusurov
Copy link

Description

The following code fails to compile with:

TypeError: Member "b" not found or not visible after argument-dependent lookup in type(contract I2).

pragma solidity 0.8.26;

interface I1 {
    function b() external;
}

interface I2 is I1 {
    function a() external;
}

// ✅ Test 1 -- passes 
contract test_a {
    function a() external view returns (bytes4) {
        return I2.a.selector;
    }
}

// ❌ Test 1 -- should pass
contract test_b {
    function b() external view returns (bytes4) {
        return I2.b.selector;
    }
}

Why?

According to official v0.8.26 documentation,

Interfaces can inherit from other interfaces. This has the same rules as normal inheritance:

@nikola-matic
Copy link
Collaborator

Thanks for the report @mnusurov.

@nikola-matic nikola-matic added should compile without error Error is reported even though it shouldn't. Source is fine. medium impact Default level of impact low effort There is not much implementation work to be done. The task is very easy or tiny. labels May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 low effort There is not much implementation work to be done. The task is very easy or tiny. medium impact Default level of impact should compile without error Error is reported even though it shouldn't. Source is fine.
Projects
None yet
Development

No branches or pull requests

2 participants