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

TypeError: Cannot read properties of undefined (reading 'length') #317

Closed
Siegrift opened this issue Nov 9, 2021 · 2 comments
Closed

TypeError: Cannot read properties of undefined (reading 'length') #317

Siegrift opened this issue Nov 9, 2021 · 2 comments

Comments

@Siegrift
Copy link

Siegrift commented Nov 9, 2021

Hi, solhint formatter just crashed on my one of my contracts. See the minimal example below to reproduce:

//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.9;

contract TestDecoder {
    function decodeNestedArray(bytes calldata data)
        public
        pure
        returns (int256[2][][3] memory decodedData)
    {
        decodedData = abi.decode(data, (int256[2][][3]));
    }
}

Solhint config:

{
  "extends": "solhint:recommended",
  "rules": {
    "compiler-version": "off",
    "func-visibility": ["warn", { "ignoreConstructors": true }],
    "not-rely-on-time": "off",
    "no-empty-blocks": "off"
  }
}

solhint version: "solhint": "^3.2.0"

This is actually an parser issue, so this might not be the best place for this issue. Full trace:
image

@Siegrift
Copy link
Author

Siegrift commented Nov 9, 2021

Also breaks with solhint version 3.3.6

jtakalai added a commit to streamr-dev/network-contracts that referenced this issue May 11, 2022
solhint chokes on parsing the file, see protofire/solhint#317
jtakalai added a commit to streamr-dev/network-contracts that referenced this issue May 11, 2022
* feat: Refactored module calling, added eslint, added tests

Also debugged tests with odd behaviour (extra allocations etc.)

* feat: no joinpolicies is ok

then joins just are always accepted

* test: make solhint happy

* test: fix test

now stake is checked when leaving ;)

* fix: merge hazard

* feat: comment out console.log from contracts

* feat: replace ternary with more readable if-then

* feat: make private field public

because why not

* feat: remove unused variable

* fix: more uniform types

* feat: more uniform interfaces: checkAbleToJoin -> onJoin

also instead of returning true throw to signal failure

* fix: PR review: move State up with fields

* test: add coverage

two things:
* sponsor using ERC677
* bounty.getStake

* fix: cleanup

* refactor: DRY out the delegate calls

extra internal call but probably worth it. So much more readable.

* test: rename arg

* test: fix error messages

* test: let ethers do BigNumber casting

for readability

* fix: storage collision

* fix: lint

* fix: lint

* build: ignore linting Bounty for now

solhint chokes on parsing the file, see protofire/solhint#317
@dbale-altoros
Copy link
Collaborator

This issue is fixed when upgrading to the last solidity parser version (0.14.5)
#378

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants