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

Compiler does not consider events when validating contract inheritance #3421

Closed
fulldecent opened this issue Jan 22, 2018 · 7 comments
Closed

Comments

@fulldecent
Copy link
Contributor

fulldecent commented Jan 22, 2018

Decision from call:

  • event overloading is fine
  • event overwriting should be disallowed (there should not be two event declarations in an inheritance hierarchy that have the same event signature (after "index" has been stripped))

error starting from 0.7.x


Test case 1:

pragma solidity ^0.5;

contract Sender {
    event Send(address from);
}

// ❌ This should fail -- event signature does not conform to parent
contract SpecialSender is Sender {
    event Send(address indexed from);
}

And after #3419 ... test case 2

interface iSender {
    event Send(address from);
}

// ❌ This should fail -- event signature does not conform to parent
interface iSpecialSender /* is iSender */ {
    event Send(address indexed from);
}
@fulldecent
Copy link
Contributor Author

Side note: I am blowing up with issues lately. Are my contributions welcome here, or am I complaining too much and wasting everyone's time? I'm doing this for fun, nobody is sponsoring me. So I hope this is having a positive impact.

Is there a chat room for actual contributors here? Gitter is all beginner questions and is absolutely useless for me.

What is the vetting process for me to become a member of the Ethereum github organization?

@chriseth
Copy link
Contributor

@fulldecent yes, we noticed :)

we have https://gitter.im/ethereum/solidity and https://gitter.im/ethereum/solidity-dev - the former is for users the latter for contributors.

As far as the issue is concerned: This is actually not different for functions. We have an open issue to restrict such inheritance for functions, it would be great if you could cross-link that!

@fulldecent
Copy link
Contributor Author

Sorry I'm having trouble finding that other issue. But here is a test case:

pragma solidity ^0.4.19;

interface A {
    function bob() public;
}

contract B is A {
    function bob(uint256 mary) public pure {
        mary = mary;
        return;
    }
}

@fulldecent
Copy link
Contributor Author

Updated per call today

@axic
Copy link
Member

axic commented Apr 1, 2020

This also compiles without warnings:

contract Sender {
    event Send(address from);
}

contract SpecialSender is Sender {
    event Send(address from) anonymous;
}

@axic
Copy link
Member

axic commented Apr 1, 2020

A longer discussion is #4168.

@chriseth
Copy link
Contributor

Fixed in #9326

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants