-
Notifications
You must be signed in to change notification settings - Fork 59
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
Problem with Scala 2.13.0-RC1 #95
Comments
@gslowikowski Interesting, I'll take a look over the weekend |
@gslowikowski it seems to be a problem with the compiler not handling final methods correctly, I've reported it here. In the meantime, you can use inline-mocking as a workaround. inline-mocking uses a different stubber that allows to mock final methods and classes, but is still not the default in Mockito as it doesn't support 100% of the use cases and feedback from the community is still being collected. To enable it, just create a simple text file Let's hope RC2 or the final version includes a fix for this. |
Thank you @bbonanno |
Update: PR that should fix this issue here |
To try this PR, you can set resolvers += "scala-integration" at
"https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/", Would be interested in knowing if everything works with that. |
@smarter It was a wise call, it works for the simple example in the PR, but it doesn't in a more complex scenario, I couldn't figure out what type of hierarchy creates it, but if you run java.lang.reflect.Modifier.isFinal(classOf[scala.reflect.io.AbstractFile].getMethod("toIterable").getModifiers) it yields |
@bbonanno Once a version of the scala-library compiled with the fixed scala-compiler is published, this should fix itself. |
@smarter Fair enough, I'll give it a go as son as RC2 is released Thanks for your help! |
The following should work: scalaVersion := 2.13.0-pre-cf9468e resolvers += "scala-integration" at
"https://scala-ci.typesafe.com/artifactory/scala-integration/", |
@smarter it works as expected Thanks! |
2.13.0-RC2 is already out :) |
@erikvanoosten Yes!, but I have to wait for my depencencies to be released compiled for RC2 (so far cats-core is the missing one). |
cats-core 2.0.0-M2 for Scala 2.13.0-RC2 is released! https://search.maven.org/artifact/org.typelevel/cats-core_2.13.0-RC2/2.0.0-M2/jar |
Fixed by #112 |
I found very strange problem with Scala
2.13.0-RC1
. Simple mocking code, that works with all previous versions, fails with this version.Check the example project https://github.com/gslowikowski/mockito-scala-2.13.0-RC1-problem
It fails with the same error with Scalatest
3.0.8-RC2
andorg.scalatestplus.mockito.MockitoSugar
class.The text was updated successfully, but these errors were encountered: