Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax error when using array slice on a bytes datatype #284

Open
abarmat opened this issue May 8, 2020 · 1 comment
Open

Syntax error when using array slice on a bytes datatype #284

abarmat opened this issue May 8, 2020 · 1 comment
Assignees
Labels

Comments

@abarmat
Copy link

abarmat commented May 8, 2020

Description
Syntax error when using array slice on a bytes datatype as allowed in Solidity 0.6

Steps to reproduce

Demo.sol

pragma solidity ^0.6.0;

contract Demo {
    event Log(bytes value);

    function log(bytes calldata value) external {
        emit Log(bytes(value[0:10]));
    }
}

Run with:

solium --dir ./contracts

.soliumrc.json

{
  "extends": "solium:recommended",
  "plugins": ["security"],
  "rules": {
    "no-experimental": ["off"],
    "quotes": ["error", "double"],
    "indentation": ["error", 4],
    "linebreak-style": ["error", "unix"],
    "security/no-inline-assembly": ["off"],
    "security/no-low-level-calls": ["off"]
  }
}

Expected behavior
The usage of array slicing on bytes calldata types should not be considered syntax error.

Solidity Documentation
https://solidity.readthedocs.io/en/v0.6.0/types.html#array-slices

Operating System
MacOS

Linter version
1.2.5

@duaraghav8
Copy link
Owner

Thanks for reporting this @abarmat
Solidity 0.6 is currently not supported by Ethlint's internal parser, so I can confirm that this is an issue on all platforms.

@duaraghav8 duaraghav8 self-assigned this May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants