Repository navigation
selfhost: add AST-aware overload candidate selector - #722
Merged
Merged
Conversation
godofecht
changed the base branch from
selfhost/overload-type-name-core
to
main
August 22, 2026 16:15
This was referenced Aug 22, 2026
godofecht
force-pushed
the
selfhost/overload-select-core
branch
from
August 23, 2026 11:01
80421d8 to
a260403
Compare
godofecht
marked this pull request as ready for review
August 23, 2026 11:08
This was referenced Aug 24, 2026
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.
Continues #677 on top of #717.
Adds
compiler/src/overload_select.flow, the pure selection layer between the native multi-signature table (#713) and TcCtx integration. It normalizes each candidate parameter with #717, applies #709 ordinary compatibility followed by unsuffixed-integer widening, and distinguishes unique selection from known no-match, genuine ambiguity, and unresolved multi-candidate calls whose argument/parameter type is not yet inferable. A sole same-name/arity candidate preserves the production resolver's unknown-type fallback instead of manufacturing a false type error.Also adds
compiler/src/overload_args.flow, which converts an AST call argument chain into normalized type rows, known/unknown flags and unsuffixed-integer markers. TcCtx supplies only identifier binding type-node IDs; literals, struct literals and casts are classified natively, with composite casts using #717 directly.Tests cover ordinary selection, u32 literal widening, widening ambiguity, sole-overload unknown fallback, unresolved multiple candidates, known no-match, literal/identifier classification, composite-cast normalization and unknown identifiers.
This PR intentionally does not mutate TcCtx yet. Once #717 and this core are qualified, the final #677 integration is limited to overload-table lifecycle/population in
typecheck.flow, identifier type-node lookup for AST_CALL arguments, invocation of these adapters, and diagnostics from the selector outcome.Related: #674 #677 #713 #715 #717 #718 #720