We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Importing overloaded methods in Solidity 0.8.12 gives an error instead of loading the methods, even if the methods are not called.
Other info that might be relevant:
Inheritance: Consider functions in all ancestors during override analysis.
Consider these 2 files created in Remix IDE
Math.sol
function sub(uint256 x, uint256 y) pure {} function sub(uint256 x, int256 y) pure {}
ImportMath.sol
sub
import {sub} from "./Math.sol";
Output error on compilation:
TypeError: No matching declaration found after variable lookup. --> ImportMath.sol:1:9: | 1 | import {sub} from "./Math.sol"; | ^^^
That means I don't know how to import those methods.
The text was updated successfully, but these errors were encountered:
So how do we fix it? Just not perform overload resolution if the reference is inside an import statement?
Sorry, something went wrong.
We didn't do it before 0.8.12, so we should just keep not doing it, yes.
Successfully merging a pull request may close this issue.
Description
Importing overloaded methods in Solidity 0.8.12 gives an error instead of loading the methods, even if the methods are not called.
Other info that might be relevant:
Unable to disambiguate shadowed function pointers #12296 (comment)
Environment
Steps to Reproduce
Consider these 2 files created in Remix IDE
Math.sol
- defines 2 methods, same name, different argumentsImportMath.sol
- just tries to import thesub
methodOutput error on compilation:
That means I don't know how to import those methods.
The text was updated successfully, but these errors were encountered: