"function" cannot be implicitly converted the same way "fun x" does. #7401
Labels
Area-Compiler-Checking
Type checking, attributes and all aspects of logic checking
Bug
Impact-Medium
(Internal MS Team use only) Describes an issue with moderate impact on existing code.
Ready
Milestone
I found this case where function can't be substituted, in relation to implicit conversion to
Func<,>
delegate.Repro steps
I'd expect those three calls to be the same, but the second one doesn't compile.
Actual behavior
The error seems incorrect in that particular context.
Expected behavior
Not sure, but it would make sense if it could compile the same as (fun x -> match x with ...) in that context.
If this can't be fixed in the language, the error could be detected to point user to the preferred solution.
related: #2907
The text was updated successfully, but these errors were encountered: