Skip to content

Resolve class reflection lazily in property promotion rename - #8546

Closed
TomasVotruba wants to merge 1 commit into
mainfrom
fix-promotion-rename-scope-dependency
Closed

TomasVotruba wants to merge 1 commit into
mainfrom
fix-promotion-rename-scope-dependency

Conversation

@TomasVotruba

Copy link
Copy Markdown
Member

Fixes IssueConstructorPromotionRenameTest.

When ClassPropertyAssignToConstructorPromotionRector runs before RenamePropertyToMatchTypeRector, it rewrites the class node. The new node has no scope attribute, so PropertyPromotionRenamer bailed out early on resolveClassReflection() (scope-based) and the rename never fired.

The class reflection is only used for the trait-usage check. Now it is resolved only when the class actually has trait uses, so the common no-trait case no longer depends on scope. Trait classes keep the same check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant