You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use anything() in my tests, the compiler sometimes is not able to infer the type of the matcher (e.g. when I use generic convenience methods that will have to pull out objects of an [Any] before checking the type and then applying the matcher).
This will lead to error messages like
Generic parameter W could not be inferred.
where W corresponds to the generic type of a matcher.
Shouldn't it be okay for anything() to return Matcher<Any> instead of Matcher<T>. The generic type T doesn't seem to be used anywhere and I wouldn't have to tell the compiler what to do by adding as Matcher<Any> to my code.
The text was updated successfully, but these errors were encountered:
When I use
anything()
in my tests, the compiler sometimes is not able to infer the type of the matcher (e.g. when I use generic convenience methods that will have to pull out objects of an[Any]
before checking the type and then applying the matcher).This will lead to error messages like
where
W
corresponds to the generic type of a matcher.Shouldn't it be okay for
anything()
to returnMatcher<Any>
instead ofMatcher<T>
. The generic typeT
doesn't seem to be used anywhere and I wouldn't have to tell the compiler what to do by addingas Matcher<Any>
to my code.The text was updated successfully, but these errors were encountered: