Repository navigation
selfhost: add canonical AST type-name normalizer - #717
Merged
Merged
Conversation
chore: sync expression classifier into type-name branch
godofecht
marked this pull request as ready for review
August 22, 2026 16:07
This was referenced Aug 22, 2026
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 with the missing Stage-A parameter-type normalization layer.
Adds
compiler/src/type_name.flow, which converts nativeAST_TYPEstructures into the exact canonical names used by the production Python parser/overload resolver for forms Stage-A can represent losslessly: plain types,ptr<T>, sized/unsizedarray<T[,N]>, generic applications,vecN<T>, and nested combinations. It includes bounded recursive formatting, decimal array-size output and capacity/depth guards.The module deliberately returns unknown for function/cfn types and for spans. Stage-A currently consumes
mutinsidespan<mut T>without preserving mutability in AST_TYPE, so emittingspan_const_*orspan_mut_*would collapse distinct productionType.namevalues. That parser metadata must be fixed before spans can participate in native overload selection.Adds
tests/lang/test_type_name_port.flowwith byte-exact vectors fori32,ptr_i32,array_4_f32,array_f32,Option_i32,Result_i32_string,vec4_i32, nestedptr_array_4_f32, refusal cases and capacity guards.Once this and #715 land, the remaining local-overload integration is to populate #713's table in TcCtx and apply #709 matching to classified/normalized AST_CALL arguments.
Related: #674 #677