You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vyper Version (output of vyper --version): 9e3b9a2
OS: linux
Python Version (output of python --version): 3.10.4
What's your issue about?
When a contract is imported, only the function signatures are semantically checked to produce the InterfaceT. Contract A can therefore import another contract B that does not compile, but Contract A would compile as long as the signatures of the imported functions of Contract B are semantically correct.
# Contract A
# a.vy
import b as B
@external
def foo(addr: address):
x: B = B(addr)
x.foo()
this was fixed in #3663. compiling a.vy now raises an exception:
Error compiling: a.vy
vyper.exceptions.InvalidType: Expected uint256 but literal can only be cast as String[3].
contract "b.vy:5", function "foo", line 5:17
4 def foo():
---> 5 x: uint256 = "foo"
------------------------^
6
Version Information
vyper --version
): 9e3b9a2python --version
): 3.10.4What's your issue about?
When a contract is imported, only the function signatures are semantically checked to produce the
InterfaceT
. Contract A can therefore import another contract B that does not compile, but Contract A would compile as long as the signatures of the imported functions of Contract B are semantically correct.h/t @trocher
How can it be fixed?
Fill this in if you know how to fix it.
The text was updated successfully, but these errors were encountered: