Skip to content

Conversation

@stoyanov-kaloyan
Copy link

@stoyanov-kaloyan stoyanov-kaloyan commented Oct 23, 2025

Added improved error message for namespace collisions in imports

resolves #4579

New error message looks like:

Error compiling: _test.vy
vyper.exceptions.NamespaceCollision: 'math' has already been declared via import (alias=`math`).

 Suggested fix: rename or remove the previous declaration (e.g. use `import math as ...` to avoid collisions)

  contract "_test.vy:2", line 2:0 
       1 from snekmate.utils import math
  ---> 2 import math
  -------^

Commit message:

feat[lang]: improve error message for namespace collision

Description for the changelog

Added a block in which it attempts to provide an easier to read hint for the user.

Cute Animal Picture

car

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message for math namespace collision

1 participant