Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Signature of anything() #27

Open
herzi opened this issue May 22, 2017 · 0 comments
Open

Signature of anything() #27

herzi opened this issue May 22, 2017 · 0 comments

Comments

@herzi
Copy link

herzi commented May 22, 2017

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant