Repository navigation
selfhost: add minimal expression type classifier for overloads - #715
Merged
Merged
Conversation
This was referenced Aug 22, 2026
chore: sync overload table into expression classifier branch
godofecht
marked this pull request as ready for review
August 22, 2026 14:00
This was referenced Aug 22, 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 after #709/#713.
Adds
compiler/src/expr_type.flow, a deliberately small Stage-A expression type classifier shaped for native overload selection. It classifies deterministic literal types (i32,f32,bool,string), accepts an already-known identifier binding type fromTcCtx, copies struct-literal names, and recognizes plain cast target type spans. Composite cast forms remain unknown until a dedicated AST_TYPE normalizer exists, rather than guessing an incomplete pointer/array spelling.Identifier type availability is represented by an explicit
has_known_ident_typeflag. Flowstringis not nullable; the first Tier-1 run correctly rejected usingnull(ptr<void>) as a string sentinel, so the API now preserves type safety rather than relying on nullable host-language habits.Also exports the syntactic unsuffixed-integer-literal marker required by #709's second-pass widening policy.
Adds
tests/lang/test_expr_type_port.flowcovering all known cases, unknown identifiers, composite-cast refusal, capacity checks and the widening marker.Next integration step after #713: populate the native overload table during global binding, obtain identifier types from
TcCtx, classify call arguments with this module, then apply #709's matching policy per candidate.Related: #674 #677