Skip to content

Conversation

@Sporarum
Copy link
Contributor

@Sporarum Sporarum commented Oct 31, 2025

What I did

Fix #4603

How I did it

Add new dict which keeps track on built-ins
It might be possible to do it with self.graph, but I don't know enough about it yet

How to verify it

Commit message

this commits refactors the way imports are checked to provide a more
user-friendly error message to users. this is done by moving the custom
handling of builtin functions after the duplicate check.

Description for the changelog

Fix error message when built-in modules are imported more than once

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@Sporarum
Copy link
Contributor Author

Fixes #4603

@Sporarum Sporarum changed the title fix[parser]: Make duplicate built-in import exception consistent fix[parser]: make duplicate built-in import exception consistent Nov 3, 2025
@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.07%. Comparing base (79d0762) to head (985f10c).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4764   +/-   ##
=======================================
  Coverage   93.07%   93.07%           
=======================================
  Files         145      145           
  Lines       20366    20366           
  Branches     3578     3578           
=======================================
  Hits        18956    18956           
  Misses        949      949           
  Partials      461      461           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Sporarum Sporarum changed the title fix[parser]: make duplicate built-in import exception consistent fix[parser]: make duplicate built-in import exception consistent (#4603) Nov 4, 2025
@charles-cooper charles-cooper changed the title fix[parser]: make duplicate built-in import exception consistent (#4603) fix[lang]: fix exception for duplicate builtin imports Nov 4, 2025
@charles-cooper
Copy link
Member

this compiles on master but not on this branch:

from ethereum.ercs import IERC20 as builtin_IERC20      # builtin             
from .ethereum.ercs import IERC20 as local_IERC20       # local file          

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.

bad compiler exception when raising duplicate imports of stdlib

2 participants