Skip to content

Eliminate the OriginalPropertyTypeExpr, GetOffsetValueTypeExpr and GetIterableKey/ValueTypeExpr virtual nodes - #6129

Merged
ondrejmirtes merged 4 commits into
2.2.xfrom
eliminate-virtual-type-nodes
Jul 28, 2026
Merged

Eliminate the OriginalPropertyTypeExpr, GetOffsetValueTypeExpr and GetIterableKey/ValueTypeExpr virtual nodes#6129
ondrejmirtes merged 4 commits into
2.2.xfrom
eliminate-virtual-type-nodes

Conversation

@ondrejmirtes

Copy link
Copy Markdown
Member

Second extraction step from the resolve-type-rewrite-2 branch (after #6125): four internal virtual Expr nodes are replaced with eager TypeExpr/NativeTypeExpr values computed directly from Scope APIs at the construction sites, and their handlers and printer methods are deleted.

  • OriginalPropertyTypeExprAssignHandler computes the original property type itself (via PropertyReflectionFinder, mirroring what the handler did) when writing into an offset of a property.
  • GetOffsetValueTypeExpr$scope->getType($e)->getOffsetValueType(...) at the two construction sites.
  • GetIterableKeyTypeExpr / GetIterableValueTypeExpr$scope->getIterableKeyType(...) / getIterableValueType(...) wrapped in NativeTypeExpr.

Behavior-neutral: no test expectations change. Shrinks the eventual resolveType-to-callback switch by four node types.

Validation performed locally: make phpstan clean, make cs clean, full make tests green (17755 tests). No turbo-shadowed class is touched.

🤖 Generated with Claude Code

https://claude.ai/code/session_019wqGgaD7iqL44t1KgpJS7b

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