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

[Bug-Candidate]: Incorrect type hint in Member, Index, Binary, and other IR operations #1830

Closed
Troublor opened this issue Apr 6, 2023 · 3 comments
Labels
bug-candidate Bugs reports that are not yet confirmed

Comments

@Troublor
Copy link
Contributor

Troublor commented Apr 6, 2023

Describe the issue:

In slither version 0.9.3, it seems the type hint of variable fields in some IR operation class is changed to SourceMapping.
For example,

def variable_left(self) -> SourceMapping:

def variable_right(self) -> SourceMapping:

def variable_left(self) -> SourceMapping:

These are just three examples in three operation class.
There could be other places with wrong type hint and I didn't enumerate all of them.

I believe this is a regression issue.
Before 0.9.3, the type hint was some class related to Variable.

Upgrading to 0.9.3 breaks all the type check in my program, which is a downstream tool using of slithIR.

Is this a breaking change? It seems not to me. The type of these variable (e.g., left_variable) being SourceMapping makes no sense to me.

Code example to reproduce the issue:

N/A

Version:

0.9.3

Relevant log output:

N/A
@Troublor Troublor added the bug-candidate Bugs reports that are not yet confirmed label Apr 6, 2023
@Troublor Troublor changed the title [Bug-Candidate]: Incorrect type hint in Member, Index, Binary IR operation [Bug-Candidate]: Incorrect type hint in Member, Index, Binary, and other IR operations Apr 6, 2023
@0xalpharush
Copy link
Contributor

I think the release only contained partial updates to the typing and further improvement were merged after the release. You may want to use dev to reflect the changes from #1666

@Troublor
Copy link
Contributor Author

Troublor commented Apr 6, 2023

I think the release only contained partial updates to the typing and further improvement were merged after the release. You may want to use dev to reflect the changes from #1666

I see. Thx.
So there are some bad unexpected changes to the type hint in the 0.9.3 release, and they have been fixed in the dev branch.
OK, so this is no longer an issue.
It is really a pain in the ass to have incorrect type hints in the released version, though. 🫠

@Troublor
Copy link
Contributor Author

Troublor commented Apr 6, 2023

Should be fixed in #1666

@Troublor Troublor closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-candidate Bugs reports that are not yet confirmed
Projects
None yet
Development

No branches or pull requests

2 participants