Repository navigation
feat(native): report declaration and scope errors natively - #1033
Merged
Merged
Conversation
kvlonge
force-pushed
the
feat/native-stage-errors
branch
from
October 8, 2026 15:20
de7a3de to
527c175
Compare
kvlonge
enabled auto-merge (squash)
October 8, 2026 15:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Native compiler stages still re-ran the Python implementation after a failure, only to get Python's exact error. For declarations and scopes that re-run is pure overhead and, under the macro bridge, executes macros twice. This is the first error-family slice of moving those errors native.
Changes
@enum/@constreferences: the native scan returns the references Python resolves plus the error that stops its walk (unclosed quote or block comment, malformed reference). The expansion raises Python's first error in walk order instead of handing the string back to Python, with shared messages.CompileInputError(code P001, same text, same lifecycleerror_typeon every engine) and carrybridge_independent=True. This includes Python's own scan errors when the native scan defers.bridge_independent.error_typeon all three engines, and five failure-corpus cases.Verification
cargo test --workspace --all-features, clippy and fmt with Rust 1.99.0make compiler-differentialwith CI flags (233 identical),make compiler-differential-shipped(227 identical),tests/e2e/scripts/compiler_differentialmake check-ci,make test, public-repository scan