-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Champion: target-typed conditional expression (VS 16.8, .NET 5) #2460
Comments
Could this also apply to the |
@YairHalberstadt This proposal is for the |
@gafter |
I don’t know. I have not thought about doing something for |
If I were to offer to implement it, would that make a difference? |
@YairHalberstadt Without a proposed specification, I have no idea. I think we'd want to review the proposed specification to decide if it were something we want or not. |
I have suggested a specification at #2473 |
Would love to see this feature added! |
This was split from #2389 and is being treated as a separate feature
For a conditional expression
c ? e1 : e2
, when there is no common type fore1
ande2
, we define a new conditional expression conversion that permits an implicit conversion from the conditional expression to any typeT
for which there is a conversion-from-expression frome1
toT
and also frome2
toT
. It is an error if a conditional expression neither has a common type betweene1
ande2
nor is subject to a conditional expression conversion.Relates to #2701 (target-typed
new[]
)The text was updated successfully, but these errors were encountered: