Proposal Question: Allow lambda conversion despite optional parameter or params
differences
#6651
Labels
Proposal Question
Question to be discussed in LDM related to a proposal
As part of supporting default parameter values in lambdas (proposal, spec), we had decided to disallow the conversion from a lambda to a delegate type when there is a mismatch between default values or
params
modifiers.For example:
I'm proposing we revisit that decision to allow that conversion and merely warn on such lambda parameter differences.
Rationale
It seems more consistent to allow the conversion, just like we allow method group conversions with similar differences, because we know how to convert.
Also, there's a bit of a parallel with tuple conversions, where we merely warn for specifying different names in a tuple literal which are useless, but we allow the conversion from a tuple type and a tuple literal despite such name differences:
Note that he failure/absence of conversion can affect overload resolution:
The text was updated successfully, but these errors were encountered: