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

InferTypes produces wrong type on public state var/fun shadowing in 0.4.x compilers #155

Open
cd1m0 opened this issue Oct 12, 2022 · 0 comments
Assignees
Labels
bug Something isn't working cac Issue discovered from running over the contract archive

Comments

@cd1m0
Copy link
Contributor

cd1m0 commented Oct 12, 2022

Given the following code:

pragma solidity 0.4.13;
contract Foo {
     bool public open;
     function open() external {
     }
     
     function main() {
        this.open();
     }
}

InferType will infer the type of this.open() to be function() instead of function() returns (bool). Since this edge case is only possible on 0.4.x (otherwise this is a compiler error), and its on a rare edge cases (seen twice in 75K contracts) that is bad coding behavior anyway (shadowing between function and public state var), we are not fixing it right away. Just marking it so we don't loose track of it.

@cd1m0 cd1m0 added the bug Something isn't working label Oct 12, 2022
@cd1m0 cd1m0 self-assigned this Oct 12, 2022
@cd1m0 cd1m0 added the cac Issue discovered from running over the contract archive label Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cac Issue discovered from running over the contract archive
Projects
None yet
Development

No branches or pull requests

1 participant