Proposal: Allow the name of an out variable to be omitted if it is not used #1125
Unanswered
jmairboeck
asked this question in
General
Replies: 1 comment
-
Use string str = ...
var isValidInt = int.TryParse(str, out _); |
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
Uh oh!
There was an error while loading. Please reload this page.
-
It should be allowed to omit the variable name of a variable declared in an out expression, if the variable is not going to be used (similar to the catch clause for example), like this:
Currently, when just saying
out int
, it is considered an "invalid expression". In theout var
case, it is reported as "identifier var not found" (because var is a contextual keyword).Beta Was this translation helpful? Give feedback.
All reactions