-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
area:overloadingbacklogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.compat:javaitype:bugstat:deprecated featureIssues tied to features which were deprecated at some point.Issues tied to features which were deprecated at some point.
Description
Compiler version
3.7.3
Minimized code
JavaImpl.java
import java.lang.ref.Reference;
public abstract class JavaImpl implements Comparable<Reference<Object>> {
@Override
public int compareTo(Reference ref) { // <Object> is omitted
return 0;
}
}ScalaImpl.scala
class ScalaImpl extends JavaImplOutput
class ScalaImpl needs to be abstract, since def compareTo(x$0: T): Int in trait Comparable in package java.lang is not defined
(Note that
parameter T in def compareTo(x$0: T): Int in trait Comparable in package java.lang does not match
parameter java.lang.ref.Reference[?] in def compareTo(ref: java.lang.ref.Reference[?]): Int in class JavaImpl
)
class ScalaImpl extends JavaImpl
Expectation
Should just compile. Note that new JavaImpl works in scala... here the compiler doesn't complain.
I understand that the scala compiler has a point with its error, but is ultimately wrong in this case and completely prevents me from overriding this class. As far as I can see there is nothing I can do (neither in scala nor in java (except from changing the method)) to implement JavaImpl in any way.
som-snytt and He-Pin
Metadata
Metadata
Assignees
Labels
area:overloadingbacklogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.compat:javaitype:bugstat:deprecated featureIssues tied to features which were deprecated at some point.Issues tied to features which were deprecated at some point.