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
I expect to be able to mock such a class and do all the normal mock-related operations.
Please provide a description of what actually happens
I am trying to mock the FileStatus class (source code here) from the Hadoop common API Java library. The following compiler errors result:
Error:(34, 24) double definition:
override def compareTo(o: Any): Int at line 34 and
override def compareTo(x$1: T): Int at line 34
have same type after erasure: (o: Object)Int
val mockFile = stub[MockFileStatus]
Error:(34, 24) name clash between defined and inherited member:
def compareTo(x$1: T): Int in trait Comparable and
override def compareTo(o: Any): Int at line 34
have same type after erasure: (x$1: Object)Int
val mockFile = stub[MockFileStatus]
The problem seems to be with the fact that this class extends Comparable without specifying any type parameters.
Any workarounds (however ugly) are welcomed. Thank you.
ScalaMock Version
3.6.0
Scala Version
2.11
Runtime (JVM or JS)
Oracle JDK 1.8.0_181
Please describe the expected behavior of the issue
I expect to be able to mock such a class and do all the normal mock-related operations.
Please provide a description of what actually happens
I am trying to mock the FileStatus class (source code here) from the Hadoop common API Java library. The following compiler errors result:
The problem seems to be with the fact that this class extends
Comparable
without specifying any type parameters.Any workarounds (however ugly) are welcomed. Thank you.
Reproducible Test Case
Note: you will need to add a dependency on hadoop-common 2.6.5.
The text was updated successfully, but these errors were encountered: