Test plan for "lambda discard parameters" #38820
Labels
Area-Compilers
Test
Test failures in roslyn-CI
Test-Gap
Describes a specific feature or scenario that does not have test coverage
Milestone
Championed issue
csharplang
(PR Create speclet for lambda discard parameters csharplang#2901)(_, _) => 0
with LangVersion 8 (error) (seeDiscardParameters_CSharp8
)(_, _) => 0
with LangVersion Preview (ok) (seeDiscardParameters
)(int _, string _) => 0
(seeDiscardParameters_WithTypes
)delegate(int _, string _) { return 0; }
(seeDiscardParameters_InDelegates
)DiscardParameters_InDelegates_WithAttribute
)DiscardParameters_NotInScope
)_
is not a discard parameter (ie. is in scope and can be read from) (seeDiscardParameters_NotADiscardWhenSingleUnderscore
)DiscardParameters_NotInScope
)IsDiscard
set totrue
_
as name_
allowed inside a lambda with discard parameters (seeDiscardParameters
)ref
,in
andout
parameters (see open question below) (seeDiscardParameters_RefAndOut
)_
parameters on local function (still error) (seeDiscardParameters_OnLocalFunction
)\u005f
doesn't cound as discard (same as in other contexts) (seeDiscardParameters_UnicodeUnderscore
)@_
is not a discard (same as in other contexts) (seeDiscardParameters_EscapedUnderscore
)DiscardParameters_ExpressionTreeNotAllowed
)Questions raised on team review today:
debugger-discards
branch, issue Display discard values when debugging #48408)_
within a scope where discard parameters exist. Some scenarios:int _ = 1; Func<int, int, int> x = (_, _) => _++; /* this currently binding to the local declared outside the lambda? */
Func<int, int, int> x = (_, _) => { int _ = 1; return _; } /* this is currently allowed */
nameof(_)
(seeDiscardParameters_NotInScope_Nameof
)verify(latest implementation removed the new parameter symbol)GetAttributes()
if we have a new symbolDiscardParameters
)GetDeclaredSymbol
(seeDiscardParameters_NotInScope
)Productivity
(discard) int _
RenameLambdaDiscard
)Open issues for LDM:
out
orref
discard?The text was updated successfully, but these errors were encountered: