- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
Regression in Scala 2.10 concerning self types
Hi,
I have the following code, which stopped compiling with the current trunk 2.10, but worked with 2.9.1:
I have the following code, which stopped compiling with the current trunk 2.10, but worked with 2.9.1:
trait TFn1B {
type In
type Out
type Apply[T <: In] <: Out
}
trait TFn1[I, O] extends TFn1B {
type In = I
type Out = O
}
trait >>[F1 <: TFn1[_, _], F2 <: TFn1[_, _]] extends TFn1[F1#In, F2#Out] {
type Apply[T] = F2#Apply[F1#Apply[T]]
}
In 2.10 the compiler complains:Fun.scala:12: error: illegal inheritance;
self-type this.>>[F1,F2] does not conform to this.TFn1[_$1,_$4]'s selftype this.TFn1[_$1,_$4]
trait >>[F1 <: TFn1[_, _], F2 <: TFn1[_, _]] extends TFn1[F1#In, F2#Out] {
^
one error found
Should I file a bug or is this expected?
Thanks and bye,
Simon










Re: Regression in Scala 2.10 concerning self types
On Mon, Jan 23, 2012 at 4:04 PM, Simon Ochsenreither <simon [dot] ochsenreither [at] googlemail [dot] com> wrote:
Neither. It's already open (SI-5399, SI-5400.) The regression arises from attempts to address SI-5120.
Re: Regression in Scala 2.10 concerning self types
On Tue, Jan 24, 2012 at 06:51, Paul Phillips wrote:
>
>
> On Mon, Jan 23, 2012 at 4:04 PM, Simon Ochsenreither
> wrote:
>>
>> Should I file a bug or is this expected?
>
>
> Neither. It's already open (SI-5399, SI-5400.) The regression arises from
> attempts to address SI-5120.
Add SI-5402 to the list, but the description of the previous two are
misleading, as they imply the problem is related to pattern matching.
There's no pattern matching in this error.