vyperlang / vyper

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

compiler can emit empty error message hint #4313

Closed cyberthirst closed 1 week ago

cyberthirst commented 1 month 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 1 month 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
charles-cooper commented 1 week ago

fixed in #4351