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
Please describe the expected behavior of the issue
Creation of mock successfully compiles
Please provide a description of what actually happens
[error] ....weaker access privileges in overriding
[error] def clone(): Object (defined in trait MyInterface)
[error] override should be public;
[error] (note that def clone(): Object (defined in trait MyInterface) is abstract,
[error] and is therefore overridden by concrete protected[package lang] def clone(): Object (defined in class Object))
[error] mock[MyInterface]
importorg.scalamock.scalatest.MockFactoryimportorg.scalatest.funsuite.AnyFunSuiteclassTestextendsAnyFunSuitewithMockFactory {
test("should be able to mock") {
mock[MyInterface] // fails to compile on 2.13.6
}
}
As discussed in scala/bug#12466 this behavior on Scala 2.13.6 is valid, so it seems ScalaMock needs to implement MyInterface by defining a public override of clone instead of leaving the protected abstract from Object.
The text was updated successfully, but these errors were encountered:
ScalaMock Version
5.1.0
Scala Version
2.13.6
Runtime
JVM
Please describe the expected behavior of the issue
Creation of mock successfully compiles
Please provide a description of what actually happens
Reproducible Test Case
As discussed in scala/bug#12466 this behavior on Scala 2.13.6 is valid, so it seems ScalaMock needs to implement
MyInterface
by defining a public override ofclone
instead of leaving theprotected
abstract fromObject
.The text was updated successfully, but these errors were encountered: