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
Currently vyper does not provide meaningful errors when incorrectly attempting imports.
When attempting to compile an incorrect relative import, such as:
# myContract.vy # foobar.vy does not exist or is named foo_bar.vy import foobar as FooBar stored_data: uint256 @public def set(new_value : uint256): self.stored_data = new_value @public @constant def get() -> uint256: return self.stored_data
Calling vyper myContract.vy returns:
vyper myContract.vy
IndexError: tuple index out of range
When comparing the behavior of vyper to solc, given a contract such as:
// myContract.sol pragma solidity >=0.4.0 <0.7.0; // foobar.sol doesn't exist or was renamed to foo_bar.sol import "./foobar.sol"; contract SimpleStorage { uint storedData; function set(uint x) public { storedData = x; } function get() public view returns (uint) { return storedData; } }
Calling solc myContract.sol returns:
solc myContract.sol
myContract.sol:5:1: Error: Source "foobar.sol" not found: File outside of allowed directories. import "./foobar.sol"; ^--------------------^
Conversely, calling solc myContract.sol --allow-paths . returns:
solc myContract.sol --allow-paths .
myContract.sol:5:1: Error: Source "foobar.sol" not found: File not found. import "./foobar.sol"; ^--------------------^
I imagine something in a similar vein would be a useful feature for vyper to have.
The text was updated successfully, but these errors were encountered:
@CruzMolina there was an error in the error message, fixed in #1395 if you'd like to test.
Sorry, something went wrong.
Sweet, thanks @jacqueswww !
Changed this to a bug report
Successfully merging a pull request may close this issue.
What's your issue about?
Currently vyper does not provide meaningful errors when incorrectly attempting imports.
When attempting to compile an incorrect relative import, such as:
Calling
vyper myContract.vy
returns:How can it be fixed?
When comparing the behavior of vyper to solc, given a contract such as:
Calling
solc myContract.sol
returns:Conversely, calling
solc myContract.sol --allow-paths .
returns:I imagine something in a similar vein would be a useful feature for vyper to have.
The text was updated successfully, but these errors were encountered: