protofire/solhint

Unicode literals implicitly converting to fixed size byte arrays cause incorrect error

Drblessing opened this issue ยท 4 comments

The contract:

// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.18.0;

contract StringFun {
    function funnyString() public pure returns (bytes10 test) {
        test = unicode"Hello ๐Ÿ˜ƒ";
    }
}

compiles and is runnable. You can test this on remix.

However, solhint throws an error:

test.sol:6:22: Error: Parse error: extraneous input '"Hello ๐Ÿ˜ƒ"' expecting ';'

@Drblessing I can't reproduce this, are you sure you're using the latest version of solhint?

Oh, thanks for the tip, probably not, I'm using a fresh remix environment and the Solhint plugin, and I'm able to reproduce it. Sorry, I can't find a version number on remix. Should I close this?

Yeah, I'd say it's probably the Remix plugin using an outdated version. I'm not sure what's the right repo to report that though. Thanks for clarifying!

Thanks for the help!