-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[BREAKING] Disallow multiple events with same name and types. #9326
Conversation
5a2210d
to
2cc8f58
Compare
test/libsolidity/syntaxTests/events/inheritance_adds_indexed.sol
Outdated
Show resolved
Hide resolved
2cc8f58
to
ca60811
Compare
event X() anonymous; | ||
} | ||
// ---- | ||
// DeclarationError 5883: (52-72): Event with same name and arguments defined twice. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually this would also clash with event Y() anonymous
, but I think we can ignore that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would it clash with Y anonymous?
cb8f68c
to
6f052bb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I rebased to fix the CI errors and fixed the two files with missing newline at EOF.
@@ -0,0 +1,5 @@ | |||
contract A { | |||
event X(); | |||
event X(uint); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add another test case with indexed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you mean ()
and (uint indexed)
? There is already one with (uint, uint)
and (uint, uint indexed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should have a test for:
contract A { event X(uint); }
contract B is A {}
contract C is A {}
contract D is B, C {}
?
I think this should be allowed and I think it is allowed with this PR, but having a test might be good.
6f052bb
to
50e5866
Compare
@ekpyron added |
50e5866
to
e7dc993
Compare
e7dc993
to
ab2f64f
Compare
Fixes #3421
Is this how we wanted it?