Repository navigation
Conversation
…n method of the same name (§16.2a), so MIR no longer lowers an unchecked body (#2403) Root cause: Zcu.expand_c_imports_frontend (src/compiler/Frontend.w) re-added every ordered declaration, c_import's generated methods included, after the tier rebuild had already run (process_imports, then expand_c_imports). A generated `xdoc.root` beside a written `impl xdoc: fn root()` was registered twice; Sema checked the written one and MIR lowered the generated body, whose call of `xdoc_root` had no resolution: "MirLower ICE: call of `xdoc_root` has callee kind 0". §16.2a: "User-written `impl` methods always take priority over auto-generated ones." The final re-add now collects the written methods' qualified names and skips a generated method with the same name, keeping the parallel path/file/ci lists in step. Test: test/behavior/behav_2403_c_sugar_yields_to_written_method.{w,h} (expect 7). The installed compiler stops with the MirLower ICE.
ehartford
marked this pull request as ready for review
October 25, 2026 21:59
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.
Root cause: Zcu.expand_c_imports_frontend (src/compiler/Frontend.w) re-added
every ordered declaration, c_import's generated methods included, after the
tier rebuild had already run (process_imports, then expand_c_imports). A
generated
xdoc.rootbeside a writtenimpl xdoc: fn root()was registeredtwice; Sema checked the written one and MIR lowered the generated body,
whose call of
xdoc_roothad no resolution: "MirLower ICE: call ofxdoc_roothas callee kind 0". §16.2a: "User-writtenimplmethods alwaystake priority over auto-generated ones."
The final re-add now collects the written methods' qualified names and skips
a generated method with the same name, keeping the parallel path/file/ci
lists in step.
Test: test/behavior/behav_2403_c_sugar_yields_to_written_method.{w,h}
(expect 7). The installed compiler stops with the MirLower ICE.
Closes #2403