Champion "Allow null coalescing operator for pointers" #9013
Replies: 7 comments
-
In dotnet/roslyn#18526 (comment) @lachbaer offers an implementation of this proposal. |
Beta Was this translation helpful? Give feedback.
-
I'd like to implement this |
Beta Was this translation helpful? Give feedback.
-
@jaredpar Is it ok for this community member to make a PR and submit it for review? Do we need anything happen process-wise before that can happen? Thanks! |
Beta Was this translation helpful? Give feedback.
-
First I think we'd need to be a little more concrete on what we're implementing here. Basically a mini-spec. Read through the 3.5 spec on
To
The rest of the rules for Also I agree with @gafter that at this point if we allow pointers on the LHS of Note: at this moment we're really swamped with wrapping up C# 9. Probably be a few weeks before we'll be getting around to new PRs particularly those which are feature related. |
Beta Was this translation helpful? Give feedback.
-
Have we considered what happens if we allow pointer types as generic arguments at some point, which would likely be a |
Beta Was this translation helpful? Give feedback.
-
In general we've thought about what would change if we allowed pointers to be generic arguments. Most recently it came up during the |
Beta Was this translation helpful? Give feedback.
-
@jaredpar fwiw this is another feature I would immediately use in WinForms. We do this a lot. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
See #323 for the original proposal (e.g. support
p ?? q
for pointer types).See also, #328 which may take this yet further and has been prototyped by a community member at dotnet/roslyn#18526 https://github.com/lachbaer/roslyn/tree/DefaultCoalescingOperator .
See also the related proposal #398 which may make sense to consider at the same time (e.g. support
p?->X
andp?[e]
for pointer types).Note: if we do this feature, then
??=
should also work on pointers.Beta Was this translation helpful? Give feedback.
All reactions