-
-
Notifications
You must be signed in to change notification settings - Fork 101
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
SuppressNullableWarningExpression should break consistently with invocation expressions #598
Conversation
…cation expressions
Some edge cases from https://github.com/belav/csharpier-repos/pull/30/files NamingStrategy namingStrategy = JsonTypeReflector.GetContainerNamingStrategy(
attribute
)!;
// is now
NamingStrategy namingStrategy = JsonTypeReflector
.GetContainerNamingStrategy(containerAttribute)
!;
// probably should be
NamingStrategy namingStrategy = JsonTypeReflector
.GetContainerNamingStrategy(containerAttribute)!;
IsUnion = JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object?>(
isUnionMethodInfo
)!;
// is now
IsUnion = JsonTypeReflector.ReflectionDelegateFactory
.CreateMethodCall<object?>(isUnionMethodInfo)
!;
MethodCall<object?, object> invoke =
JsonTypeReflector.ReflectionDelegateFactory.CreateMethodCall<object?>(invokeFunc)!;
// is now
MethodCall<object?, object> invoke = JsonTypeReflector.ReflectionDelegateFactory
.CreateMethodCall<object?>(invokeFunc)
!;
private static readonly MethodInfo CallPropertySetterOpenGenericMethod =
typeof(PropertySetter).GetMethod(
nameof(CallPropertySetter),
BindingFlags.NonPublic | BindingFlags.Static
)!;
// is now
private static readonly MethodInfo CallPropertySetterOpenGenericMethod = typeof(PropertySetter)
.GetMethod(nameof(CallPropertySetter), BindingFlags.NonPublic | BindingFlags.Static)
!;
var deserialized =
(JSInProcessObjectReference)JsonSerializer.Deserialize<IJSInProcessObjectReference>(
json,
JsonSerializerOptions
)!;
// is now
var deserialized = (JSInProcessObjectReference)JsonSerializer
.Deserialize<IJSInProcessObjectReference>(json, JsonSerializerOptions)
!;
// is it weird if we do something like?
_uiThreadId = (int)_window
.GetType()
.GetField("_managedThreadId", BindingFlags.NonPublic | BindingFlags.Instance)
!.GetValue(_window)!; |
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.
Hmmmm. You know, when I first skimmed through the .cst
files everything looked "fine".
We've probably been overthinking this. The vast majority of people won't look at this in detail and accept whatever we output without question.
closes #596