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
scala>classFooextendsD
<console>:7:error: illegal inheritance;
classFoo inherits different typeinstances of traitA:A[T] and A[T]
classFooextendsD
^
The problem appeared when trying to subclass org.apache.commons.buffer.PriorityBuffer, so there are real life situations where this leads to scala<->java interop problems.
@soc said (edited on Aug 25, 2011 11:07:45 AM UTC):
This looks at least related to #3634, which involves raw types. I'm pretty sure though, that there are also other duplicates about this ...
The source code in the source jar defines:
public classPriorityBufferextendsAbstractCollection implements Buffer, Serializable { ... }
So basically:
this involves raw types, which are not supported in Scala
Sun/Oracle reserves the right to remove support of raw types from javac in the future
=> this will most probably be a WON'T FIX
=> it is Apache's duty to fix it (but considering that the last release was 2008, I consider the library to be not maintained)
@daniel: Your best chance is to file a bug in Apache's bug tracker for it.
An Illegal inheritance error is thrown by the compiler trying to inherit java classes/ interfaces in the following way:
Trying to subclass D in scala:
The problem appeared when trying to subclass org.apache.commons.buffer.PriorityBuffer, so there are real life situations where this leads to scala<->java interop problems.
http://commons.apache.org/collections/apidocs/org/apache/commons/collections/buffer/PriorityBuffer.html
The text was updated successfully, but these errors were encountered: