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

Fix data location "calldata" in external function parameters throws an "Unused variable" error #135

Closed
wants to merge 3 commits into from

Conversation

mariano-aguero
Copy link
Contributor

Closes #96

The error occurs when using Truffle 5 and Solidity 0.5.0.

The PR removes an unused function called getLocFromIndex so the coverage will be increased.
If the no-unused-vars rule adds a variable to validate it, we check if the variable have the expression calldata. Also added some tests.

Regards

@mariano-aguero mariano-aguero self-assigned this Aug 8, 2019
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 98.191% when pulling 54e0ed9 on hotfix/data-location-call-data into 98c3ea4 on master.

rules: { 'no-unused-vars': 'error' }
})

assert.equal(report.errorCount, 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why there are no errors here? bar is not used inside this function. Is there something special about calldata that makes it being excluded from the no-unused-vars rule?

@fernandomg fernandomg deleted the hotfix/data-location-call-data branch November 19, 2019 15:00
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

Successfully merging this pull request may close these issues.

Data location "calldata" in external function parameters throws an "Unused variable" error
3 participants