Closed illuzen closed 7 years ago
The same is displayed if you use "String" instead of "string" or use "type" as a variable name. I haven't actually seen a sane compiler error, so I don't even know if this functionality exists? (clearly, I'm one of the above-mentioned noobs).
🤣 we should definitely strive for clear error messages. I've been meaning to dig into the compiler sauce, so maybe I'll make that my first project, make it spit out at least a line number or something. Whatever I have at /usr/local/bin/solc gives reasonable errors, so it's probably just a matter of passing them thru the javascript.
Yes I'm sure we're gonna save a lot of people a lot of time by checking for these things when compiling
I had another one. A variable with the name "contract"
This error is also generated if you happen to replace contracts/Migrations.sol
with the code demonstrated here: http://truffle.readthedocs.io/en/beta/getting_started/migrations/
The actual Migrations.sol
code generated by truffle init
(on v3.2.5) is different to the code stated at the above link which does not build.
How the hell am I supposed to debug my code :(. I waited until writing 10 contracts to compile
If it says: Compiling ./contracts/MyContract.sol...
and then I see this 5 5
error, is it safe to assume the error is in MyContract.sol, or is it in the next (not printed) contract?
Wow you cannot even see which file is getting the compilation error. Can this be high prio please?
Might try to make time for this to help with this issue if no one is pushing any PR for this yet.
@GlenDC I spent a little time on it, didn't figure out which layer it's occurring at, so have at it. 👍
@illuzen @GlenDC I'm interested at taking a crack at it, but I can't find the source code for truffle other than the giant bundle. Is there some other branch I can checkout?
I'm getting this error too, it's annoying
Honestly, I think it's because I'm trying to index a byte array, and then overwrite it. That is not allowed in Solidity; indexing is read-only.
Had the same problem. Took me very long to debug. Using linter-solidity for Atom helped. (in case u use Atom) https://atom.io/packages/linter-solidity
@beether from the giant bundle's README: https://github.com/trufflesuite/truffle-core
The same problem too. Just because of a typo in a variable name in an expression like abc += 1
.
This is an error in Solidity. It will be fixed when we upgrade to Solidity 0.4.13. Please see #484 to track our progress. Thanks!
None of the answers helped me but adding Solium to my tool chain and running the commands:
solium --init
solium --dir .
In the root of the project, helped pinpoint the errors in my .sol
files. After I addressed the errors, running truffle compile
and truffle migrate
worked fine.
This issue has been fixed. Please upgrade to the latest version of Truffle. Thanks!
Just thought I'd pass this along. If you don't put parenthesis around your return type in the function signature, for example like this
you get this:
5 5
/usr/local/lib/node_modules/truffle/node_modules/solc/wrapper.js:48 throw e; ^ abort(5) at Error at jsStackTrace (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:1:19718) at stackTrace (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:1:19901) at abort (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:19:15285) at Array.dXb (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:11:585101) at Array.tX (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:8:557453) at Array.eea (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:6:495332) at Object.wOb [as dynCall_ii] (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:11:540050) at invoke_ii (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:1:1275129) at Array.ixa (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:7:494308) at Object.bVb [as dynCall_viii] (/usr/local/lib/node_modules/truffle/node_modules/solc/soljson.js:11:577232) If this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.
This will probably confuse noobs, which might be a good thing. It will make them stronger. It's not like there's anywhere else for them to go.
Environment