Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nullable constructor promotion detection #321

Merged
merged 1 commit into from
Apr 13, 2024

Conversation

sirbrillig
Copy link
Owner

When trying to detect variables that are constructor promotion (see #266 and #294) we might also have variables that have nullable types. These variables were not being correctly identified as constructor promotion because the token we were examining to see if it was public/private/protected was actually not far enough back and we were instead looking at the ?.

In this diff, we check for and ignore nullable tokens when looking for constructor promotion.

Fixes #320

@sirbrillig sirbrillig merged commit ca242a0 into 2.x Apr 13, 2024
56 checks passed
@sirbrillig sirbrillig deleted the fix-nullable-constructor-promotion branch April 13, 2024 16:42
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.

Handle constructor promotion with Nullable types
1 participant