vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.86k stars 793 forks source link

compiler can emit empty error message hint #4313

Open cyberthirst opened 6 days ago

cyberthirst commented 6 days ago

Version Information

What's your issue about?

@external
def foo() -> uint256:
    d: DynArray[uint256, 10] = [d]
    return d[0]
Error compiling: tests/custom/test4.vy
vyper.exceptions.UndeclaredDefinition: 'd' has not been declared.

  contract "tests/custom/test4.vy:3", function "foo", line 3:32 
       2 def foo() -> uint256:
  ---> 3     d: DynArray[uint256, 10] = [d]
  ---------------------------------------^
       4     return d[0]

  (hint: )

see (hint: )

How can it be fixed?

Fill this in if you know how to fix it.

cyberthirst commented 3 days ago

another test case:

import lib1

uses: lib1

@deploy
def __init__():
    lib1.__interface__(self).__init__()

exports: lib1.__interface__

#lib1.vy
k: uint256

@external
def bar():
    pass

@deploy
def __init__():
    self.k = 10