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

Discuss: disallow visibility specifiers in constructor functions #2638

Closed
federicobond opened this issue Jul 26, 2017 · 5 comments
Closed

Discuss: disallow visibility specifiers in constructor functions #2638

federicobond opened this issue Jul 26, 2017 · 5 comments

Comments

@federicobond
Copy link
Contributor

I was doing some experiments with visibility specifiers and noticed that constructor functions can be defined as internal. This causes the contract to be marked as abstract, but child contracts can call the super constructor without problems.

Are there any real world use cases of this? Is it something we would like to support?

@axic
Copy link
Member

axic commented Jul 26, 2017

Prior reading #979 😉

@axic
Copy link
Member

axic commented Oct 26, 2017

Example code:

contract A {
  uint public a;

  function A(uint _a) internal {
    a = _a;
  }
}

contract B is A(1) {
  function B() {}
}

@axic
Copy link
Member

axic commented Dec 2, 2017

@federicobond the reason is explained in #3132. Is there any need to keep this issue?

@federicobond
Copy link
Contributor Author

No need. We can close it.

@Tectract
Copy link

I'm not sure I understand the full implications of public versus internal constructor functions, but I know I'm getting a compiler warning on the "standard" erc20 token contract in the latest solc compiler version. Is it safe to just make the constructor as public?

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

No branches or pull requests

3 participants