Combining null-conditional member access and null-coalescing with ref struct
#7003
Unanswered
PetSerAl
asked this question in
Language Ideas
Replies: 1 comment
-
Regardless of any compiler optimizations, this is not how the language defines this codepattern. The type of |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
C# compiler reject
M21
method because it think, that subexpressionc?.RefStruct
have typeNullable<RefStruct>
, which is not allowed. Although expression as whole never cause any instance ofNullable<RefStruct>
to be created, and semantically equivalent methodM22
compiled without any error.Should compiler allow this code pattern for
ref struct
?Beta Was this translation helpful? Give feedback.
All reactions