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

type proxies and (re)-wrapping

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

SimpleTypeProxy tell us:

trait SimpleTypeProxy extends Type {
def underlying: Type

// the following operations + those in RewrappingTypeProxy are all
operations
// in class Type that are overridden in some subclass
// Important to keep this up-to-date when new operations are added!

RewrappingTypeProxy echoes something similar.

As of r25687 we can see what operations are and aren't touched upon.
I can write the logic to distinguish "is overridden in some subclass"
from "isn't", but I was hoping to aim at something more general. This
lengthy list of unwrapped methods raises my suspicion that it has not
in fact been kept up-to-date with new operations. I'm not that clear
on how the failure to wrap would materialize so I don't know how big
an issue it is. Looking at this output, does anything strike more
than the usual amount of fear into your heart?

/** With respect to class Type, trait SimpleTypeProxy wraps:
*/
trait Wrapped {
def baseClasses: List[Types.this.Symbol]
def baseType(clazz: Types.this.Symbol): Types.this.Type
def baseTypeSeq: Types.this.BaseTypeSeq
def baseTypeSeqDepth: Int
def boundSyms: scala.collection.immutable.Set[Types.this.Symbol]
def bounds: Types.this.TypeBounds
def decls: Types.this.Scope
def finalResultType: Types.this.Type
def isErroneous: Boolean
def isError: Boolean
def isHigherKinded: Boolean
def isNotNull: Boolean
def isStable: Boolean
def isTrivial: Boolean
def isVolatile: Boolean
def paramSectionCount: Int
def paramTypes: List[Types.this.Type]
def params: List[Types.this.Symbol]
def paramss: List[List[Types.this.Symbol]]
def parents: List[Types.this.Type]
def prefix: Types.this.Type
def termSymbol: Types.this.Symbol
def termSymbolDirect: Types.this.Symbol
def typeConstructor: Types.this.Type
def typeOfThis: Types.this.Type
def typeParams: List[Types.this.Symbol]
def typeSymbol: Types.this.Symbol
def typeSymbolDirect: Types.this.Symbol
def widen: Types.this.Type
}

/** With respect to class Type, trait SimpleTypeProxy does NOT wrap:
*/
trait Unwrapped {
def <:<(that: Types.this.Type): Boolean
def =:=(that: Types.this.Type): Boolean
def annotations: List[Types.this.AnnotationInfo]
def asSeenFrom(pre: Types.this.Type,clazz: Types.this.Symbol): Types.this.Type
def atOwner(owner: Types.this.Symbol): Types.this.Type
def baseTypeIndex(sym: Types.this.Symbol): Int
def cloneInfo(owner: Types.this.Symbol): Types.this.Type
def complete(sym: Types.this.Symbol): Unit
def computeMemberType(sym: Types.this.Symbol): Types.this.Type
def contains(sym: Types.this.Symbol): Boolean
def containsTp(tp: Types.this.Type): Boolean
def dealias: Types.this.Type
def decl(name: Types.this.Name): Types.this.Symbol
def deconst: Types.this.Type
def deferredMembers: List[Types.this.Symbol]
def existentialSkolems: List[Types.this.Symbol]
def exists(p: Types.this.Type => Boolean): Boolean
def filter(p: Types.this.Type => Boolean): List[Types.this.Type]
def find(p: Types.this.Type => Boolean): Option[Types.this.Type]
def findMember(name: Types.this.Name,excludedFlags:
Long,requiredFlags: Long,stableOnly: Boolean): Types.this.Symbol
def foreach(f: Types.this.Type => Unit): Unit
def hasAnnotation(clazz: Types.this.Symbol): Boolean
def implicitMembers: List[Types.this.Symbol]
def instantiateTypeParams(formals: List[Types.this.Symbol],actuals:
List[Types.this.Type]): Types.this.Type
def isComplete: Boolean
def isDependent: Boolean
def isFinalType: Boolean
def isGround: Boolean
def isImmediatelyDependent: Boolean
def isStructuralRefinement: Boolean
def isWildcard: Boolean
def kind: String
def load(sym: Types.this.Symbol): Unit
def looselyMatches(that: Types.this.Type): Boolean
def map(f: Types.this.Type => Types.this.Type): Types.this.Type
def matches(that: Types.this.Type): Boolean
def matchesPattern(that: Types.this.Type): Boolean
def member(name: Types.this.Name): Types.this.Symbol
def memberInfo(sym: Types.this.Symbol): Types.this.Type
def memberType(sym: Types.this.Symbol): Types.this.Type
def members: List[Types.this.Symbol]
def narrow: Types.this.Type
def nonLocalMember(name: Types.this.Name): Types.this.Symbol
def nonPrivateDecl(name: Types.this.Name): Types.this.Symbol
def nonPrivateMember(name: Types.this.Name): Types.this.Symbol
def nonPrivateMemberAdmitting(name: Types.this.Name,admit: Long):
Types.this.Symbol
def nonPrivateMembers: List[Types.this.Symbol]
def nonPrivateMembersAdmitting(admit: Long): List[Types.this.Symbol]
def normalize: Types.this.Type
def notNull: Types.this.Type
def prefixChain: List[Types.this.Type]
def prefixString: java.lang.String
def remove(clazz: Types.this.Symbol): Types.this.Type
def resultApprox: Types.this.Type
def resultType(actuals: List[Types.this.Type]): Types.this.Type
def resultType: Types.this.Type
def safeToString: String
def selfsym: Types.this.Symbol
def skolemizeExistential(owner: Types.this.Symbol,origin: AnyRef):
Types.this.Type
def skolemizeExistential: Types.this.Type
def specializes(sym: Types.this.Symbol): Boolean
def stat_<:<(that: Types.this.Type): Boolean
def stripAnnotations: Types.this.Type
def subst(from: List[Types.this.Symbol],to: List[Types.this.Type]):
Types.this.Type
def substSuper(from: Types.this.Type,to: Types.this.Type): Types.this.Type
def substSym(from: List[Types.this.Symbol],to:
List[Types.this.Symbol]): Types.this.Type
def substThis(from: Types.this.Symbol,to: Types.this.Type): Types.this.Type
def toLongString: String
def trimPrefix(str: String): java.lang.String
def typeArgs: List[Types.this.Type]
def underlying: Types.this.Type
def weak_<:<(that: Types.this.Type): Boolean
def withAnnotation(annot: Types.this.AnnotationInfo): Types.this.Type
def withAnnotations(annots: List[Types.this.AnnotationInfo]): Types.this.Type
def withSelfsym(sym: Types.this.Symbol): Types.this.Type
def withoutAnnotations: Types.this.Type
protected def objectPrefix: java.lang.String
protected def packagePrefix: java.lang.String
}

/** With respect to class Type, trait RewrappingTypeProxy wraps:
*/
trait Wrapped {
def atOwner(owner: Types.this.Symbol): Types.this.Type
def baseClasses: List[Types.this.Symbol]
def baseType(clazz: Types.this.Symbol): Types.this.Type
def baseTypeSeq: Types.this.BaseTypeSeq
def baseTypeSeqDepth: Int
def boundSyms: scala.collection.immutable.Set[Types.this.Symbol]
def bounds: Types.this.TypeBounds
def cloneInfo(owner: Types.this.Symbol): Types.this.Type
def complete(sym: Types.this.Symbol): Unit
def dealias: Types.this.Type
def decls: Types.this.Scope
def deconst: Types.this.Type
def finalResultType: Types.this.Type
def instantiateTypeParams(formals: List[Types.this.Symbol],actuals:
List[Types.this.Type]): Types.this.Type
def isComplete: Boolean
def isErroneous: Boolean
def isError: Boolean
def isHigherKinded: Boolean
def isNotNull: Boolean
def isStable: Boolean
def isTrivial: Boolean
def isVolatile: Boolean
def load(sym: Types.this.Symbol): Unit
def narrow: Types.this.Type
def normalize: Types.this.Type
def notNull: Types.this.Type
def paramSectionCount: Int
def paramTypes: List[Types.this.Type]
def params: List[Types.this.Symbol]
def paramss: List[List[Types.this.Symbol]]
def parents: List[Types.this.Type]
def prefix: Types.this.Type
def prefixString: java.lang.String
def resultType(actuals: List[Types.this.Type]): Types.this.Type
def resultType: Types.this.Type
def skolemizeExistential(owner: Types.this.Symbol,origin: AnyRef):
Types.this.Type
def termSymbol: Types.this.Symbol
def termSymbolDirect: Types.this.Symbol
def typeArgs: List[Types.this.Type]
def typeConstructor: Types.this.Type
def typeOfThis: Types.this.Type
def typeParams: List[Types.this.Symbol]
def typeSymbol: Types.this.Symbol
def typeSymbolDirect: Types.this.Symbol
def widen: Types.this.Type
def withAnnotations(annots: List[Types.this.AnnotationInfo]): Types.this.Type
def withoutAnnotations: Types.this.Type
}

/** With respect to class Type, trait RewrappingTypeProxy does NOT wrap:
*/
trait Unwrapped {
def <:<(that: Types.this.Type): Boolean
def =:=(that: Types.this.Type): Boolean
def annotations: List[Types.this.AnnotationInfo]
def asSeenFrom(pre: Types.this.Type,clazz: Types.this.Symbol): Types.this.Type
def baseTypeIndex(sym: Types.this.Symbol): Int
def computeMemberType(sym: Types.this.Symbol): Types.this.Type
def contains(sym: Types.this.Symbol): Boolean
def containsTp(tp: Types.this.Type): Boolean
def decl(name: Types.this.Name): Types.this.Symbol
def deferredMembers: List[Types.this.Symbol]
def existentialSkolems: List[Types.this.Symbol]
def exists(p: Types.this.Type => Boolean): Boolean
def filter(p: Types.this.Type => Boolean): List[Types.this.Type]
def find(p: Types.this.Type => Boolean): Option[Types.this.Type]
def findMember(name: Types.this.Name,excludedFlags:
Long,requiredFlags: Long,stableOnly: Boolean): Types.this.Symbol
def foreach(f: Types.this.Type => Unit): Unit
def hasAnnotation(clazz: Types.this.Symbol): Boolean
def implicitMembers: List[Types.this.Symbol]
def isDependent: Boolean
def isFinalType: Boolean
def isGround: Boolean
def isImmediatelyDependent: Boolean
def isStructuralRefinement: Boolean
def isWildcard: Boolean
def kind: String
def looselyMatches(that: Types.this.Type): Boolean
def map(f: Types.this.Type => Types.this.Type): Types.this.Type
def matches(that: Types.this.Type): Boolean
def matchesPattern(that: Types.this.Type): Boolean
def member(name: Types.this.Name): Types.this.Symbol
def memberInfo(sym: Types.this.Symbol): Types.this.Type
def memberType(sym: Types.this.Symbol): Types.this.Type
def members: List[Types.this.Symbol]
def nonLocalMember(name: Types.this.Name): Types.this.Symbol
def nonPrivateDecl(name: Types.this.Name): Types.this.Symbol
def nonPrivateMember(name: Types.this.Name): Types.this.Symbol
def nonPrivateMemberAdmitting(name: Types.this.Name,admit: Long):
Types.this.Symbol
def nonPrivateMembers: List[Types.this.Symbol]
def nonPrivateMembersAdmitting(admit: Long): List[Types.this.Symbol]
def prefixChain: List[Types.this.Type]
def remove(clazz: Types.this.Symbol): Types.this.Type
def resultApprox: Types.this.Type
def safeToString: String
def selfsym: Types.this.Symbol
def skolemizeExistential: Types.this.Type
def specializes(sym: Types.this.Symbol): Boolean
def stat_<:<(that: Types.this.Type): Boolean
def stripAnnotations: Types.this.Type
def subst(from: List[Types.this.Symbol],to: List[Types.this.Type]):
Types.this.Type
def substSuper(from: Types.this.Type,to: Types.this.Type): Types.this.Type
def substSym(from: List[Types.this.Symbol],to:
List[Types.this.Symbol]): Types.this.Type
def substThis(from: Types.this.Symbol,to: Types.this.Type): Types.this.Type
def toLongString: String
def trimPrefix(str: String): java.lang.String
def underlying: Types.this.Type
def weak_<:<(that: Types.this.Type): Boolean
def withAnnotation(annot: Types.this.AnnotationInfo): Types.this.Type
def withSelfsym(sym: Types.this.Symbol): Types.this.Type
protected def objectPrefix: java.lang.String
protected def packagePrefix: java.lang.String
}

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