ScopeLift / scopelint

An opinionated formatting and linting tool for foundry projects
78 stars 5 forks source link

Scopelint fails on parsing named mapping types #24

Closed roberts-pumpurs closed 1 year ago

roberts-pumpurs commented 1 year ago

Scopelint fails on parsing named mappings. Language feature introduced in Solidity 0.8.18

The following Solidity snippet crashes scopelint check:

mapping(address asset => uint256 balance) private _balances;
thread 'main' panicked at 'Parsing failed: [Diagnostic { loc: File(0, 958, 963), level: Error, ty: ParserError, message: "unrecognised token 'asset', expected \"=>\"", notes: [] }]', /[redacted]/.cargo/registry/src/github.com-1ecc6299db9ec823/scopelint-0.0.15/src/check/mod.rs:68:69
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
roberts-pumpurs commented 1 year ago

I see that this only exists on the latest 0.0.15 version (the one currently available from crates.io). The latest version available on Github main branch does not have this issue (post solang-parser update).

Could a new release on crates.io please be created?

mds1 commented 1 year ago

Ah, yea main has the updated parser to handle the new solidity features. Just prepared the release, should be live once this action finishes https://github.com/ScopeLift/scopelint/actions/runs/4386059892

mds1 commented 1 year ago

v0.0.16 is now published!