-
Notifications
You must be signed in to change notification settings - Fork 100
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
Overloaded method cannot be mocked if one of its parameters is a generic available to the trait. #93
Comments
Using scalamock v4.1.0 with scalatestplus-play v3.1.2:
Getting compile error: value expects is not a member of .... @pawel-wiejacha Interestingly, if I remove |
Still struggling with it on ScalaMock 5.1.0, ScalaTest 3.2.7, and Scala 2.13.6. Is there any known workaround for this problem? I try to stub the http4s Client trait without any success due to this issue. |
What you can try is to not use a trait with a parameter.
try
and then subsequently mock |
I've run into this problem while trying to mock
This too results in:
|
Still experiencing this issue when trying to mock In my case the suggested above workaround didn't work, here is what I tried: trait RBucketString extends RBucket[String]
...
val mockRBucket = mock[RBucketString]
...
(mockRBucket.setAsync(_: String)).expects(*).returns... I get a compilation error: value expects is not a member of String => org.redisson.api.RFuture[Void] |
I'm encountering what I suspect is the same issue trying to mock
I am trying to mock
fails with Why do I think this might be the same issue? |
Works with scala 3 |
reported by @trane in #39:
Returns:
The text was updated successfully, but these errors were encountered: