You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Names such as _, __, etc. are commonly used to indicate that they're otherwise ignored, which is now "official" syntax in some instances such as out _.
There are cases where you want to evaluate an expression for its side effects, but are otherwise uninterested in the results, this would be written as var _ = expression;. It's also a relatively common convention to use (_, __) => blah for a lambda that's used as an event handler (sender, args) if you don't want to use the delegate{blah} syntax for ignoring arguments.
I'd like to propose names that are made up of only underscores to not trigger SA1312.
The text was updated successfully, but these errors were encountered:
There are cases where you want to evaluate an expression for its side effects, but are otherwise uninterested in the results, this would be written as var _ = expression;.
The new discard form for these is:
_=expression;
The discard syntax does not trigger SA1312, and can be used any number of times within the same method.
It's also a relatively common convention to use (_, __) => blah for a lambda that's used as an event handler (sender, args) if you don't want to use the delegate{blah} syntax for ignoring arguments.
This is SA1313, and covered by previous issue #1606.
Names such as
_
,__
, etc. are commonly used to indicate that they're otherwise ignored, which is now "official" syntax in some instances such asout _
.There are cases where you want to evaluate an expression for its side effects, but are otherwise uninterested in the results, this would be written as
var _ = expression;
. It's also a relatively common convention to use(_, __) => blah
for a lambda that's used as an event handler (sender, args) if you don't want to use thedelegate{blah}
syntax for ignoring arguments.I'd like to propose names that are made up of only underscores to not trigger SA1312.
The text was updated successfully, but these errors were encountered: