This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Regression in Scala 2.10 concerning self types

2 replies
Simon Ochsenreither
Joined: 2011-07-17,
User offline. Last seen 42 years 45 weeks ago.
Hi,

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

extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.
Re: Regression in Scala 2.10 concerning self types


On Mon, Jan 23, 2012 at 4:04 PM, Simon Ochsenreither <simon.ochsenreither@googlemail.com> 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.
dcsobral
Joined: 2009-04-23,
User offline. Last seen 38 weeks 5 days ago.
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.

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland