Skip to content

bug: wrong column offset in error message #3430

@tserg

Description

@tserg

Version Information

  • vyper Version (output of vyper --version): ed0a654
  • OS: linux
  • Python Version (output of python --version): 3.10.8

What's your issue about?

Some vyper keywords like log, event, struct and interface are replaced with the python keyword class in pre-parsing, causing the locations of these tokens to differ from the vyper tokens. As a result, the column offset is misaligned for certain errors - see the ASCII arrow below.

event A:
    b: uint256

@external
def f():
    log A(d)
vyper.exceptions.UndeclaredDefinition: 'd' has not been declared. 
  contract "tmp/offset.vy:6", function "f", line 6:12 
       5 def f():
  ---> 6     log A(d)
  -------------------^
       7

h/t @trocher @ptrcarta

How can it be fixed?

Fill this in if you know how to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions