Skip to content

fix(common): explicit error in contractToInterface #3660

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dk1a
Copy link
Contributor

@dk1a dk1a commented Apr 10, 2025

Currently this is essentially an uncaught bug that causes uint256[1 + 2 + 3] to become uint256[], which leads to incorrect system interfaces and libraries
Very minor issue, I imagine people rarely if ever use expressions in static arrays, but an explicit error is better than a weird bug I guess

To actually fix this error and support complex expressions requires unparse of some sort, which solidity-parser doesn't have

nomic's slang does have unparse, and is generally much better (and recently 1.0, which is why I didn't use it for contractToInterface initially)
btw if you want I can migrate contractToInterface to slang when I have time, shouldn't be hard

@dk1a dk1a requested a review from alvrs as a code owner April 10, 2025 18:42
Copy link

changeset-bot bot commented Apr 10, 2025

⚠️ No Changeset found

Latest commit: 9410944

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant