Skip to content

selfhost: add minimal expression type classifier for overloads - #715

Merged
godofecht merged 5 commits into
mainfrom
selfhost/overload-expr-type-core
Aug 22, 2026
Merged

godofecht merged 5 commits into
mainfrom
selfhost/overload-expr-type-core

Conversation

@godofecht

@godofecht godofecht commented Aug 22, 2026 •

Copy link
Copy Markdown
Contributor

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 from TcCtx, 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_type flag. Flow string is not nullable; the first Tier-1 run correctly rejected using null (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.flow covering 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

chore: sync overload table into expression classifier branch
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