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 an imported interface is typed, the namespace of the current contract is used to generate the interface type from the AST of the imported contract. This means that the imported contract's function definitions may use the types and constants defined in the current contract. For example a.vy would compile successfully although b.vy, which is imported by a.vy makes use of S and a, both defined in a.vy.
# a.vy
import b as B
struct S:
x: uint256
a: constant(uint256) = 12
@external
def bar(addr: address):
x: B = B(addr)
y: S = x.foo()
Version Information
vyper --version
): 9e3b9a2python --version
): 3.10.4What's your issue about?
When an imported interface is typed, the namespace of the current contract is used to generate the interface type from the AST of the imported contract. This means that the imported contract's function definitions may use the types and constants defined in the current contract. For example
a.vy
would compile successfully althoughb.vy
, which is imported bya.vy
makes use ofS
anda
, both defined ina.vy
.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: