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

Mark FindClosestParent<T>() callers as possibly null-returning #6303

Merged
merged 6 commits into from
May 29, 2024

Conversation

bdach
Copy link
Collaborator

@bdach bdach commented May 27, 2024

RFC.

In particular, the important callers in question here are GetContainingInputManager() and GetContainingFocusManager(). The hope is that with proper nullability annotations, #6302 would have been caught by static analysis.

When preparing this, I saw that about 20% of calls to GetContainingFocusManager() already handled null, and the rest did not. Make of that what you will.

Game-side branch for preview of impact: https://github.com/ppy/osu/compare/master...bdach:osu:find-closest-parent-null-adjustments?expand=1

@bdach bdach force-pushed the find-closest-parent-null branch from 3f4ec4f to 64e95e6 Compare May 27, 2024 09:33
Copy link
Contributor

@smoogipoo smoogipoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In principle I'm fine with this but I have to mention that the use of ?. vs .AsNonNull() doesn't make much sense to me.

There's a few other cases than the two I mentioned in this review.

osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
osu.Framework/Testing/TestBrowser.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/Containers/TabbableContainer.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/UserInterface/Menu.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/UserInterface/Menu.cs Outdated Show resolved Hide resolved
osu.Framework/Graphics/UserInterface/TextBox.cs Outdated Show resolved Hide resolved
osu.Framework/Testing/TestBrowser.cs Outdated Show resolved Hide resolved
Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
smoogipoo
smoogipoo previously approved these changes May 29, 2024
@smoogipoo smoogipoo merged commit 1201e64 into ppy:master May 29, 2024
13 checks passed
@bdach bdach deleted the find-closest-parent-null branch May 29, 2024 12:52
@bdach bdach mentioned this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants