Skip to content
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

Let conditional operator ?: work on nullable #17204

Closed
Thaina opened this issue Feb 17, 2017 · 1 comment
Closed

Let conditional operator ?: work on nullable #17204

Thaina opened this issue Feb 17, 2017 · 1 comment
Labels
Area-External Resolution-External The behavior lies outside the functionality covered by this repository

Comments

@Thaina
Copy link

Thaina commented Feb 17, 2017

Sometimes we have bool? condition. Such as dictionary?.TryGetValue(key,out value)

When I want it to return dictionary?.TryGetValue(key,out value) ? value : null it cause error

Maybe we should support ?:?? like this?

return dictionary?.TryGetValue(key,out value) ? value : null ?? null

or maybe just

/// Nullable<bool> ? true : false : null
return dictionary?.TryGetValue(key,out value) ? value : null : null`
@gafter gafter added Area-External Resolution-External The behavior lies outside the functionality covered by this repository labels Feb 17, 2017
@gafter
Copy link
Member

gafter commented Feb 17, 2017

Language feature requests no longer go in this repository. They go in https://github.com/dotnet/csharplang

This particular issue is already on the language design team's radar. See dotnet/csharplang#33

@gafter gafter closed this as completed Feb 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-External Resolution-External The behavior lies outside the functionality covered by this repository
Projects
None yet
Development

No branches or pull requests

2 participants