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

coevolution for you "refined" types

No replies
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

Things I wonder about, #1:

What does it mean that all these pairs of prefixes reach coevolveSym,
generally of the form (Foo.this.type, x.type) where the comment says:

// TODO: is there another way a typeref's symbol can refer to a symbol
defined in its pre?

> ??coevolve type Filter : (Evt) => Boolean to type Filter : (Evt) => Boolean with Publisher.this.type -> that.type
> ??coevolve type Input : scala.util.parsing.input.Reader[Parsers.this.Elem] to type Input : scala.util.parsing.input.Reader[Parsers.this.Elem] with Parsers.this.type -> Tester.this.syntactic.type
> ??coevolve type Int : Int to type Int : Int with Int.this.type -> scala.collection.generic.BitOperations.Int.type
> ??coevolve type Int : Int to type Int : Int with Int.this.type -> scala.collection.immutable.IntMapUtils.type
> ??coevolve type Long : Long to type Long : Long with Long.this.type -> scala.collection.immutable.LongMapUtils.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> _14.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> _15.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> _16.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> _230.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> _231.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> sub.type
> ??coevolve type Merger : [B1]((A, B1), (A, B1)) => (A, B1) to type Merger : [B1]((A, B1), (A, B1)) => (A, B1) with HashMap.this.type -> that.type
> ??coevolve type Result : R to type Result : R with GroupBy.this.type -> that.type
> ??coevolve type Result : R to type Result : R with ToParCollection.this.type -> that.type
> ??coevolve type Result : R to type Result : R with ToParMap.this.type -> that.type
> ??coevolve type Result : R to type Result : R with Zip.this.type -> that.type
> ??coevolve type Result : R to type Result : R with ZipAll.this.type -> that.type
> ??coevolve type SCPI : ParArray.this.SignalContextPassingIterator[ParArray.this.ParArrayIterator] to type SCPI : ParArray.this.SignalContextPassingIterator[ParArray.this.ParArrayIterator] with ParArray.this.type -> pa.type
> ??coevolve type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] to type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] with Repetition.this.type -> _261.type
> ??coevolve type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] to type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] with Repetition.this.type -> _289.type
> ??coevolve type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] to type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] with Repetition.this.type -> _290.type
> ??coevolve type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] to type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] with Repetition.this.type -> _297.type
> ??coevolve type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] to type SCPI : Repetition.this.SignalContextPassingIterator[Repetition.this.ParIterator] with Repetition.this.type -> _298.type
> ??coevolve type Sub : scala.collection.mutable.Subscriber[Evt,Publisher.this.Pub] to type Sub : scala.collection.mutable.Subscriber[Evt,Publisher.this.Pub] with Publisher.this.type -> that.type

Things I wonder about, #2: what does it mean, exactly, that refinements
always have "non-interesting" prefixes? One man's interesting is another
man's not so interesting. Does it mean they have no undetermined type
parameters and/or abstract types? The referenced comment is:

> /** Return pre.baseType(clazz), or if that's NoType and clazz is a refinement, pre itself.
> * See bug397.scala for an example where the second alternative is needed.
> * The problem is that when forming the base type sequence of an abstract type,
> * any refinements in the base type list might be regenerated, and thus acquire
> * new class symbols. However, since refinements always have non-interesting prefixes
> * it looks OK to me to just take the prefix directly. */

Curious about who shows up in typeref, I compiled the library logging
the ones where sym.name is REFINE_CLASS_NAME and prefix != NoPrefix.
It's true, these are not very interesting prefixes.

> GenericParTemplate.this.type sym = args = List()
> MailBox.this.type sym = args = List()
> MarkupParser.this.type sym = args = List()
> PackratParsers.this.type sym = args = List()
> Parsers.this.type sym = args = List()
> SetLike.this.type sym = args = List()
> Tester.this.type sym = args = List()
> ThreadPoolRunner.this.type sym = args = List()
> Types.this.type sym = args = List()
> XMLEventReader.this.type sym = args = List()
> scala.collection.JavaConversions.type sym = args = List()
> scala.collection.generic.type sym = args = List()
> scala.collection.immutable.type sym = args = List()
> scala.collection.mutable.type sym = args = List()
> scala.collection.parallel.mutable.type sym = args = List()
> scala.collection.parallel.type sym = args = List()
> scala.collection.type sym = args = List()
> scala.ref.type sym = args = List()
> scala.reflect.NameTransformer.type sym = args = List()
> scala.reflect.type sym = args = List()
> scala.xml.parsing.type sym = args = List()

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