-
Notifications
You must be signed in to change notification settings - Fork 5k
Separate GetResourceString method with defaultString value. #51073
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
Conversation
It's not used in Release build and it injects ununsed null value to every callsite
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Is this true? e.g. Line 26 in 79ae74f
runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs Line 206 in 79ae74f
runtime/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFacts.cs Line 209 in 79ae74f
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That said, splitting it seems fine. Most assemblies don't need the latter.
@@ -23,11 +23,11 @@ internal static partial class SR | |||
false; | |||
#endif | |||
|
|||
internal static string GetResourceString(string resourceKey, string? defaultString = null) | |||
internal static string GetResourceString(string resourceKey) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This creates a difference from its .vb counterpart.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it matter? The only place where it's used is in archived Microsoft.VisualBasic.Core library
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know that it matters, but I wanted to call it out.
cc: @tarekgh
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only place where it's used is in archived Microsoft.VisualBasic.Core library
that is right. if this change is not affecting Microsoft.VisualBasic.Core
, it should be ok. But should we just keep C# and VB match for consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rather not touch Microsoft.VisualBasic.Core code and I don't think the consistency matters here.
runtime/src/libraries/System.ComponentModel.TypeConverter/src/System/Timers/TimersDescriptionAttribute.cs The value is always null. I intentionally didn't want to mix the clean up with PR runtime/src/libraries/System.Private.CoreLib/src/System/Diagnostics/StackTrace.cs That's the only case runtime/src/libraries/Microsoft.CSharp/src/Microsoft/CSharp/RuntimeBinder/Errors/ErrorFacts.cs The assembly is archived so I didn't update the code (it's not worth it) The only cases where it's really used in Release build are StackTrace.cs and System.ComponentModel.Annotations library if that's what you were asking for. |
I was mainly questioning the assertion. |
It's not used in Release build and it injects ununsed null value to every callsite