scala / bug

Scala 2 bug reports only. Please, no questions — proper bug reports only.
https://scala-lang.org
232 stars 21 forks source link

2.10 regression: “error: illegal inheritance; self-type does not conform to ...” #6211

Open scabug opened 12 years ago

scabug commented 12 years ago

The following (minimized) code compiled with 2.9, but fails to compile with 2.10:

  trait TFn1[I] { type In = I }
  trait >>[F1 <: TFn1[_], F2 <: TFn1[_]] extends TFn1[F1#In]
<console>:8: error: illegal inheritance;
 self-type >>[F1,F2] does not conform to TFn1[_$1]'s selftype TFn1[_$1]
         trait >>[F1 <: TFn1[_], F2 <: TFn1[_]] extends TFn1[F1#In]
                                                        ^
scabug commented 12 years ago

Imported From: https://issues.scala-lang.org/browse/SI-6211?orig=1 Reporter: @soc Affected Versions: 2.10.0-M1, 2.10.0-M2, 2.10.0-M3, 2.10.0-M4, 2.10.0-M5, 2.10.0-M6

scabug commented 12 years ago

@paulp said: Regression was in https://github.com/scala/scala/commit/b7b81ca286 .

scabug commented 12 years ago

@paulp said: By the way, from looking at the point of regression, it was apparent it would compile like this:

trait TFn1[I] { type In <: I }
trait >>[F1 <: TFn1[_], F2 <: TFn1[_]] extends TFn1[F1#In]

Here's another formulation which compiles which may be useful in the presumed non-toy example.

trait TFn1[I] { type In0 <: I ; type In = In0 }
trait >>[F1 <: TFn1[_], F2 <: TFn1[_]] extends TFn1[F1#In0]
scabug commented 11 years ago

@adriaanm said: seems fixed in 2.10.1

scabug commented 11 years ago

@JamesIry said: Not fixed in 2.10.1 or in 2.10.x.