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: make _convert_to_structure_to_list return a type instead of an ElementaryType's type field #1935

Merged

Conversation

kevinclancy
Copy link
Contributor

Fix #1918

@kevinclancy kevinclancy requested a review from montyly as a code owner May 23, 2023 22:23
@CLAassistant
Copy link

CLAassistant commented May 23, 2023

CLA assistant check
All committers have signed the CLA.

@0xalpharush
Copy link
Contributor

Would you mind making this against the dev branch please?

@kevinclancy kevinclancy changed the base branch from master to dev May 23, 2023 22:52
@kevinclancy kevinclancy force-pushed the upstream-pr/struct-destruct-fix branch from b623dcd to 3419be0 Compare May 23, 2023 23:31
@kevinclancy kevinclancy force-pushed the upstream-pr/struct-destruct-fix branch from 3419be0 to e651d3d Compare May 23, 2023 23:46
Comment on lines 1586 to 1589
if isinstance(return_type, (ElementaryType, UserDefinedType, TypeAlias)):
return [return_type]

assert False
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we change the isinstance check to an assert instead of asserting False?

Comment on lines 1586 to 1589
if isinstance(return_type, (ElementaryType, UserDefinedType, TypeAlias)):
return [return_type]

assert False
Copy link
Contributor

@0xalpharush 0xalpharush Jun 4, 2023

Choose a reason for hiding this comment

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

Suggested change
if isinstance(return_type, (ElementaryType, UserDefinedType, TypeAlias)):
return [return_type]
assert False
assert isinstance(return_type, (ElementaryType, UserDefinedType, TypeAlias))
return [return_type]

@kevinclancy kevinclancy requested a review from 0xalpharush June 5, 2023 22:58
@0xalpharush
Copy link
Contributor

Can you format this please?

@kevinclancy
Copy link
Contributor Author

Yes. Done.

@0xalpharush 0xalpharush merged commit 3ed6dee into crytic:dev Jun 7, 2023
@chenhuitao chenhuitao deleted the upstream-pr/struct-destruct-fix branch March 18, 2024 10:41
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.

[Bug]: struct-destructuring assignments generate tuple variable whose "type" is a list of strings
3 participants