duaraghav8 / Ethlint

(Formerly Solium) Code quality & Security Linter for Solidity
https://ethlint.readthedocs.io/en/latest/
MIT License
927 stars 128 forks source link

`payable` keyword not working, getting error "Syntax error: unexpected token p" #244

Closed miguelmota closed 5 years ago

miguelmota commented 5 years ago
pragma solidity >0.4.99 <0.6.0;

contract Example {
    address payable public alice;

    constructor(address payable _alice) public {
      alice = _alice;
    }
}
solium -f contracts/Example.sol

packages/channel-contracts/contracts/Example.sol
  4:21    error    Syntax error: unexpected token p

✖ 1 error found.
duaraghav8 commented 5 years ago

@miguelmota Thanks for reporting this. I'm not sure whether payable can be used with address (or maybe my solidity knowledge is outdated), could you please point me to any official examples or doc on this?

miguelmota commented 5 years ago

@duaraghav8 it's part of 0.5 https://solidity.readthedocs.io/en/v0.5.0/050-breaking-changes.html

duaraghav8 commented 5 years ago

solved in v1.2.0

This linter is now being published simultaneously to npm packages solium and ethlint. Although not mandatory, I highly recommend that you move to ethlint.

See changelog Please let me know in case any of the 0.5 features are still causing trouble.