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 a couple of new r# inspections #25552

Merged
merged 2 commits into from Nov 24, 2023
Merged

Fix a couple of new r# inspections #25552

merged 2 commits into from Nov 24, 2023

Conversation

peppy
Copy link
Sponsor Member

@peppy peppy commented Nov 23, 2023

No description provided.

@@ -119,12 +119,11 @@ public double GetMostCommonBeatLength()
IBeatmap IBeatmap.Clone() => Clone();

public Beatmap<T> Clone() => (Beatmap<T>)MemberwiseClone();

public override string ToString() => BeatmapInfo.ToString();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This thing I find slightly disconcerting because there's this but there's also

if (beatmapInfo != null)
beatmapInfo.Difficulty = difficulty.Clone();

if (beatmapInfo?.Difficulty != null)
Difficulty = beatmapInfo.Difficulty.Clone();

What are these other nullchecks? How does r# even infer that this can never be null, on a file with disabled nullability annotations no less?

Copy link
Sponsor Member Author

Choose a reason for hiding this comment

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

I've enabled NRT and fixed those. It does seem to pass the test gauntlet at least.

@bdach bdach merged commit 02c794c into ppy:master Nov 24, 2023
17 checks passed
@peppy peppy deleted the fix-r#-inpsections branch November 24, 2023 06:10
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.

None yet

2 participants