solc-typed-ast
solc-typed-ast copied to clipboard
InferTypes produces wrong type on public state var/fun shadowing in 0.4.x compilers
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.