Skip to content

Warn about functions named "constructor".#3923

Merged
axic merged 1 commit intodevelopfrom
warnConstructor
Apr 18, 2018
Merged

Warn about functions named "constructor".#3923
axic merged 1 commit intodevelopfrom
warnConstructor

Conversation

@chriseth
Copy link
Contributor

Fixes #3915

m_errorReporter.warning(_function.location(), "Modifiers of functions without implementation are ignored." );
}
if (_function.name() == "constructor")
m_errorReporter.warning(_function.location(), "This function is named \"constructor\" but is not the constructor of the contract.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may want a better text here. Like the one we give when using the old-style constructor.

@chriseth
Copy link
Contributor Author

@axic updated

@chriseth
Copy link
Contributor Author

Fixed the test failure.

@axic axic merged commit 39b7b44 into develop Apr 18, 2018
@axic axic deleted the warnConstructor branch April 18, 2018 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments