Closed andy840119 closed 1 year ago
Will trying to import in the https://github.com/karaoke-dev/osu-framework-font/issues/222 first.
And note that https://github.com/karaoke-dev/LrcParser is using this flag as default.
see: https://github.com/karaoke-dev/LrcParser/blob/main/LrcParser/LrcParser.csproj
See https://github.com/ppy/osu-framework/pull/5241 for an automated script
Seems some of the compile issue is related to the ResolvedAttribute
.
Guess should wait until this issue solved.
Not really sure should mark this property as nullable because it will not be null after BDL.
Or will use null!
in o!f and lazer?
[Resolved]
private ILyricRubyTagsChangeHandler rubyTagsChangeHandler { get; set; } = null!;
Or will use
null!
in o!f and lazer?[Resolved] private ILyricRubyTagsChangeHandler rubyTagsChangeHandler { get; set; } = null!;
Yep, this is the only workaround we have (for now? for ever?).
https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis
Not have deep looking about this but seems AllowNullAttribute
works also.
Not really sure how to combine those two attributes, trying to solve this but got no answer.
@smoogipoo A quick question:
Will Children
or InternalChildren
still accept null?
Like this one:
public IReadOnlyList<T>? Children
{
get
{
if (Content != this)
return Content.Children;
return internalChildrenAsT;
}
set => ChildrenEnumerable = value;
}
Or will change to this one which only accept empty array?
public IReadOnlyList<T> Children
{
get
{
return internalChildrenAsT;
}
set => ChildrenEnumerable = value;
}
Will eventually be non-null only, the second one above.
Man, this table did not update for a while.
I think it's OK to close this issue because only has few nullable disable annotation in this project.
See how this issue did: https://github.com/ppy/osu/pull/18743/commits
We need to add this line in the
.csproj
, see this commit https://github.com/ppy/osu/pull/18743/commits/968640c95176f4a771ab6208234045f40e4ca281Also, notice that we will not add the#nullable
in the.cs
file. should fix all relative issue in the class.And because it will be hard to fix it in a single PR, so might be separate into several parts:
Beatmap
-> #1402 (exceptKaraokeBeatmapResourcesProvider
)Bindables
-> #1404Config
-> #1401Difficulty
-> #1407Checkers
-> #1398Generator
-> #1399Caret algorithm
-> #1395State
-> #1423Utils
-> #1989Extension
-> #1418IO
JsonSerializer
-> #1421Judgement
-> #1403Localization
-> #1400Mods
-> #1397Objects
-> #1406Online
-> #1403Replay
-> #1405Scoring
-> #1403Skinning
-> #1412Timing
-> #1403Utils
-> #1408Root
-> #2041In the test case:
Helpers
-> #1409Resources
-> #1409And notice that should apply in the test project also.
Highlight
part means it's non-graphic and should be able to remove the#nullable
Note:
about the removing script