First-class System.Action<...>
and System.Func<...>
#8445
Unanswered
RenderMichael
asked this question in
Language Ideas
Replies: 1 comment 8 replies
-
I suppose you can indeed introduce the new overloads and use the new "Overload Resolution Priority" feature of C# 13, to make those overloads be preferred. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the following does not compile, citing an ambiguous method resolution issue:
We have some custom delegates in our libraries, and we would like to support the "common" delegate types (as part of migrating away from custom delegates entirely). However, we cannot introduce overloads without causing issues, and the only way we can migrate is with a breaking change.
The
Action
andFunc
families are currently natural types for lambdas. It would be consistent and beneficial if they were considered "better" when there's multiple delegate types that match.Beta Was this translation helpful? Give feedback.
All reactions