Error:
Warning: Defining constructors as functions with the same name as the contract is deprecated. Use "constructor(...) { ... }" instead.
function CappedCrowdsale(uint256 _cap) public {
^ (Relevant source part starts here and spans across multiple lines).
not valid for functions.oc tag @dev
Compilation failed. See above.
I got this same exact error when my token contract was not using the new constructor()
convention.
What is odd, is after I switch the token contract to the new convention, the compiler was happy. The next day it did the same thing, broke and complained about my crowdsale contract not using the new convention. (weird it didn't complain about this the day before) This was last week. I resolved the issue by switching to constructor()
.
Now I did a git pull
on my laptop to continue work today, and now it's not happy with the constructor call made to the inherited contract, CappedCrowdsale
.
function CappedCrowdsale(uint256 _cap) public { ^ (Relevant source part
starts here and spans across multiple lines).
not valid for functions.oc tag @dev
Googling has not turned up anything helpful. And troubleshooting on my own has not turned up any positive outcomes. I'm not 100% sure the constructor
convention causing this error as it's only deprecated. But perhaps something related around that?
not valid for functions.oc tag @dev
Compilation failed. See above.
- leaves me clueless
Edit: I've restarted my computer and now compile doesn't give any warning about the constructor
convention. Only the 1 liner error above. Last week this occurred on my desktop. Today is on my laptop.
Edit x2: Narrow down the issue to the laptop. Same code base is working without issue on my desktop. Perhaps something needs updated/reinstalled? Will update when I figure it out. The warnings are separate, nonrelated, to the compile failure.
Compilation failed. See above
(I forgot to include that line on the very bottom - just now fixed). Solc versions are the same as it gets pulled from the package.json file in the tooling setup and there are no global instances installed via NPM. – Matt Swezey Jun 7 '18 at 15:14// @dev
will fail but// @dev Dummy
will work. This also happened with other tags like@title
etc. This issue appears to be unrelated to the warnings. – Ismael Jun 7 '18 at 16:50@dev
before as well. I do agree that the warnings and compile issues are unrelated as well. I've narrowed this down to the laptop; as the same project works without issue on my desktop. i will to try narrow down exactly what is breaking on my laptop and update here if I find the solution. – Matt Swezey Jun 7 '18 at 22:31