Incorrect Ambiguous invocation

I have the following 2 helper methods:


public static U IfNotNull<T, U>( this T instance, Func func) where T : class { Argument.NotNull("func", func); return instance != null ? func(instance) : default(U); } public static void IfNotNull]]>( this T instance, Action action) where T : class { Argument.NotNull("action", action); if (instance != null) { action(instance); } } When trying to use the one with the Action]]> call resharper says it can also use the Func one with the second argument as void, but then complains that void can't be used, the code compiles fine though, for now I specify the generic part myself to resharper knows which one to use.

1 comment
Comment actions Permalink

Hello,

We appreciate your feedback. The corresponding JIRA request has been created,
and you are welcome to monitor its status at http://www.jetbrains.net/jira/browse/RSRP-59359.

You may want to check our request tracking policy here: http://www.jetbrains.net/confluence/display/ReSharper/ReSharperIssueTracker

Best regards,
- Development Team.


0

Please sign in to leave a comment.