Skip to content

feat[lang]: solidity-style custom errors #4791

Draft
AlbertoCentonze wants to merge 1 commit intovyperlang:masterfrom
AlbertoCentonze:custom-errors
Draft

feat[lang]: solidity-style custom errors #4791
AlbertoCentonze wants to merge 1 commit intovyperlang:masterfrom
AlbertoCentonze:custom-errors

Conversation

@AlbertoCentonze
Copy link
Contributor

@AlbertoCentonze AlbertoCentonze commented Dec 4, 2025

What I did

Asked codex to implement solidity style custom errors in vyper. Need to clean some slop before this is viable.

How I did it

How to verify it

Commit message

Commit message for the final, squashed PR. (Optional, but reviewers will appreciate it! Please see our commit message style guide for what we would ideally like to see in a commit message.)

Description for the changelog

Cute Animal Picture

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

@AlbertoCentonze AlbertoCentonze changed the title feat[...]: solidity style custom errors feat[lang]: solidity style custom errors Dec 4, 2025
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT
from vyper.semantics.types.primitives import AddressT
from vyper.semantics.types.user import EventT, FlagT, StructT, _UserType
from vyper.semantics.types.user import ErrorT, EventT, FlagT, StructT, _UserType

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'ErrorT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of ErrorT occurs after the cyclic
import
of vyper.semantics.types.module.
'ErrorT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of ErrorT occurs after the cyclic
import
of vyper.semantics.types.module.
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT
from vyper.semantics.types.primitives import AddressT
from vyper.semantics.types.user import EventT, FlagT, StructT, _UserType
from vyper.semantics.types.user import ErrorT, EventT, FlagT, StructT, _UserType

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'EventT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of EventT occurs after the cyclic
import
of vyper.semantics.types.module.
'EventT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of EventT occurs after the cyclic
import
of vyper.semantics.types.module.
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT
from vyper.semantics.types.primitives import AddressT
from vyper.semantics.types.user import EventT, FlagT, StructT, _UserType
from vyper.semantics.types.user import ErrorT, EventT, FlagT, StructT, _UserType

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'FlagT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of FlagT occurs after the cyclic
import
of vyper.semantics.types.module.
'FlagT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of FlagT occurs after the cyclic
import
of vyper.semantics.types.module.
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT
from vyper.semantics.types.primitives import AddressT
from vyper.semantics.types.user import EventT, FlagT, StructT, _UserType
from vyper.semantics.types.user import ErrorT, EventT, FlagT, StructT, _UserType

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'StructT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of StructT occurs after the cyclic
import
of vyper.semantics.types.module.
'StructT' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of StructT occurs after the cyclic
import
of vyper.semantics.types.module.
from vyper.semantics.types.function import ContractFunctionT, MemberFunctionT
from vyper.semantics.types.primitives import AddressT
from vyper.semantics.types.user import EventT, FlagT, StructT, _UserType
from vyper.semantics.types.user import ErrorT, EventT, FlagT, StructT, _UserType

Check failure

Code scanning / CodeQL

Module-level cyclic import Error

'_UserType' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of _UserType occurs after the cyclic
import
of vyper.semantics.types.module.
'_UserType' may not be defined if module
vyper.semantics.types.user
is imported before module
vyper.semantics.types.module
, as the
definition
of _UserType occurs after the cyclic
import
of vyper.semantics.types.module.
@AlbertoCentonze AlbertoCentonze changed the title feat[lang]: solidity style custom errors feat[lang]: solidity-style custom errors Dec 4, 2025
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 76.66667% with 35 lines in your changes missing coverage. Please review.
✅ Project coverage is 93.16%. Comparing base (ae020c0) to head (da98136).

Files with missing lines Patch % Lines
vyper/semantics/types/user.py 62.12% 18 Missing and 7 partials ⚠️
vyper/codegen/stmt.py 80.00% 3 Missing and 3 partials ⚠️
vyper/semantics/analysis/utils.py 0.00% 1 Missing and 1 partial ⚠️
vyper/semantics/types/module.py 92.85% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4791      +/-   ##
==========================================
- Coverage   93.29%   93.16%   -0.14%     
==========================================
  Files         140      140              
  Lines       20277    20402     +125     
  Branches     3554     3576      +22     
==========================================
+ Hits        18917    19007      +90     
- Misses        912      935      +23     
- Partials      448      460      +12     

☔ 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.

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.

1 participant