Remove IBindable.ToString()
default interface implementations
#5571
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is essentially a workaround for what is ostensibly going to be a xamarin or mono bug which is causing ppy/osu#21530.
The explanation is thus: The reason why the config files were zero-byte is that an exception was being thrown (and silenced) in
PerformSave()
. This is the exception:This stack trace is nonsense. There is no conceivable pathway wherein
IniConfigManager
can callBindable.Parse()
. The arguments didn't make sense either, it was trying to parseCultureInfo.InvariantCulture
as a string.@frenzibyte suggested on discord that we've seen this sort of black magic before and it was caused by default interface method implementations. It tracked, since the symptoms did look suspiciously like the correct arguments were being passed to the completely wrong method. I tried removing them and that fixed the bug. Hence this diff.
I am very explicitly not looking at the xamarin bug, as to me it is not worth the time to do so and my goal is to keep things mostly working until we can collectively turn our heads towards net6 (relevant discord conversation from earlier today).
Now:
.ToString()
default implementations are, as far as I can tell, 100% dead code. I have no idea what can call these ever. A quick sharplab suggests that it is impossible for these to be called, so they are removed without replacement..ToString(IFormatProvider)
overload was the one actually causing the bug. I considered just removing it, but then ended up adding an extension method to cover for it, and allIFormattable
s to ever possibly exist. Which is arguably cleaner than duplicating the default implementations inIBindable<T>
, at the cost of an extrausing
.