You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been unable to find a combination of !/?/() to suppress the warnings on this ternary:
voidProblem(boolcondition){refobjectmyRef=ref(condition?ref GetObjectRef()!:ref GetNullableObjectRef()!)!;// Assuming these are methods whose shape I can't changestaticrefobjectGetObjectRef()=>ref Unsafe.NullRef<object>();staticrefobject?GetNullableObjectRef()=>ref Unsafe.NullRef<object?>();}
@jjonescz Is it expected that now you can suppress nullability mismatch for foreach with ref variables but not for foreach with regular variables?
It looks like the following test is supposed to cover that scenario, but it's missing the actual nullability mismatch because the parameter of the test method is object[] instead of object?[]
Version Used:
SDK 9.0.100-preview.6.24303.15
Steps to Reproduce:
While you can suppress NRT warnings on simple assignments like so
I've been unable to find a combination of
!
/?
/()
to suppress the warnings on this ternary:SharpLab
Diagnostic Id:
Expected Behavior:
I should be able to suppress warnings with some combination of
!
s.Actual Behavior:
I can only avoid warnings via
#nullable disable
.The text was updated successfully, but these errors were encountered: