aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-11-22 18:12:42 +0100
committerMartin Odersky <odersky@gmail.com>2013-11-22 18:12:42 +0100
commit9e1bf7743355de040a23fbcfe9b1efb9b1db1789 (patch)
treec12488e5c5756bccfcf34ff3407c696b0e543b54
parent3d98269f2db2542373f76f519fd3643b7bcf75cf (diff)
downloaddotty-9e1bf7743355de040a23fbcfe9b1efb9b1db1789.tar.gz
dotty-9e1bf7743355de040a23fbcfe9b1efb9b1db1789.tar.bz2
dotty-9e1bf7743355de040a23fbcfe9b1efb9b1db1789.zip
Renaming: typeConstructor -> typeRef
-rw-r--r--src/dotty/tools/dotc/ast/Desugar.scala12
-rw-r--r--src/dotty/tools/dotc/ast/TreeInfo.scala2
-rw-r--r--src/dotty/tools/dotc/ast/TypedTrees.scala8
-rw-r--r--src/dotty/tools/dotc/ast/UntypedTrees.scala2
-rw-r--r--src/dotty/tools/dotc/core/Annotations.scala8
-rw-r--r--src/dotty/tools/dotc/core/Constants.scala22
-rw-r--r--src/dotty/tools/dotc/core/Definitions.scala72
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala8
-rw-r--r--src/dotty/tools/dotc/core/Symbols.scala4
-rw-r--r--src/dotty/tools/dotc/core/TypeComparer.scala2
-rw-r--r--src/dotty/tools/dotc/core/TypeOps.scala2
-rw-r--r--src/dotty/tools/dotc/core/Types.scala12
-rw-r--r--src/dotty/tools/dotc/core/pickling/ClassfileParser.scala22
-rw-r--r--src/dotty/tools/dotc/core/pickling/UnPickler.scala2
-rw-r--r--src/dotty/tools/dotc/core/transform/Erasure.scala4
-rw-r--r--src/dotty/tools/dotc/parsing/TreeBuilder.scala.unused2
-rw-r--r--src/dotty/tools/dotc/typer/Namer.scala2
-rw-r--r--src/dotty/tools/dotc/typer/Typer.scala6
-rw-r--r--test/test/baseTypetest.sc25
-rw-r--r--test/test/denotTest.sc68
-rw-r--r--test/x/xplore.sc98
21 files changed, 191 insertions, 192 deletions
diff --git a/src/dotty/tools/dotc/ast/Desugar.scala b/src/dotty/tools/dotc/ast/Desugar.scala
index cbac66b6b..62f02dc82 100644
--- a/src/dotty/tools/dotc/ast/Desugar.scala
+++ b/src/dotty/tools/dotc/ast/Desugar.scala
@@ -175,7 +175,7 @@ object desugar {
}
else Nil
- def anyRef = ref(defn.AnyRefAlias.typeConstructor)
+ def anyRef = ref(defn.AnyRefAlias.typeRef)
def parentConstr(tpt: Tree) = Select(New(tpt), nme.CONSTRUCTOR)
val parents1 = if (parents.isEmpty) parentConstr(anyRef) :: Nil else parents
@@ -314,7 +314,7 @@ object desugar {
}
def makeAnnotated(cls: Symbol, tree: Tree)(implicit ctx: Context) =
- Annotated(TypedSplice(tpd.New(cls.typeConstructor)), tree)
+ Annotated(TypedSplice(tpd.New(cls.typeRef)), tree)
private def derivedValDef(mods: Modifiers, named: NameTree, tpt: Tree, rhs: Tree) =
ValDef(mods, named.name.asTermName, tpt, rhs).withPos(named.pos)
@@ -509,7 +509,7 @@ object desugar {
// begin desugar
tree match {
case SymbolLit(str) =>
- New(ref(defn.SymbolClass.typeConstructor), (Literal(Constant(str)) :: Nil) :: Nil)
+ New(ref(defn.SymbolClass.typeRef), (Literal(Constant(str)) :: Nil) :: Nil)
case InterpolatedString(id, strs, elems) =>
Apply(Select(Apply(Ident(nme.StringContext), strs), id), elems)
case InfixOp(l, op, r) =>
@@ -528,7 +528,7 @@ object desugar {
}
case PrefixOp(op, t) =>
if ((ctx.mode is Mode.Type) && op == nme.ARROWkw)
- AppliedTypeTree(ref(defn.ByNameParamClass.typeConstructor), t)
+ AppliedTypeTree(ref(defn.ByNameParamClass.typeRef), t)
else
Select(t, nme.UNARY_PREFIX ++ op)
case Parens(t) =>
@@ -536,7 +536,7 @@ object desugar {
case Tuple(ts) =>
if (unboxedPairs) {
def PairTypeTree(l: Tree, r: Tree) =
- AppliedTypeTree(ref(defn.PairClass.typeConstructor), l :: r :: Nil)
+ AppliedTypeTree(ref(defn.PairClass.typeRef), l :: r :: Nil)
if (ctx.mode is Mode.Type) ts.reduceRight(PairTypeTree)
else if (ts.isEmpty) unitLiteral
else ts.reduceRight(Pair(_, _))
@@ -549,7 +549,7 @@ object desugar {
unitLiteral
}
else if (arity == 1) ts.head
- else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleClass.typeConstructor), ts)
+ else if (ctx.mode is Mode.Type) AppliedTypeTree(ref(tupleClass.typeRef), ts)
else if (arity == 0) unitLiteral
else Apply(ref(tupleClass.companionModule.symRef), ts)
}
diff --git a/src/dotty/tools/dotc/ast/TreeInfo.scala b/src/dotty/tools/dotc/ast/TreeInfo.scala
index 60344267f..ed9b1b81a 100644
--- a/src/dotty/tools/dotc/ast/TreeInfo.scala
+++ b/src/dotty/tools/dotc/ast/TreeInfo.scala
@@ -224,7 +224,7 @@ trait TreeInfo[T >: Untyped] { self: Trees.Instance[T] =>
/** Does this CaseDef catch Throwable? */
def catchesThrowable(cdef: CaseDef)(implicit ctx: Context) =
- catchesAllOf(cdef, defn.ThrowableClass.typeConstructor)
+ catchesAllOf(cdef, defn.ThrowableClass.typeRef)
/** Does this CaseDef catch everything of a certain Type? */
def catchesAllOf(cdef: CaseDef, threshold: Type)(implicit ctx: Context) =
diff --git a/src/dotty/tools/dotc/ast/TypedTrees.scala b/src/dotty/tools/dotc/ast/TypedTrees.scala
index 8a966696f..315796c65 100644
--- a/src/dotty/tools/dotc/ast/TypedTrees.scala
+++ b/src/dotty/tools/dotc/ast/TypedTrees.scala
@@ -148,7 +148,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def SeqLiteral(elems: List[Tree])(implicit ctx: Context): SeqLiteral =
untpd.SeqLiteral(elems)
- .withType(defn.SeqClass.typeConstructor.appliedTo(ctx.typeComparer.lub(elems.tpes)))
+ .withType(defn.SeqClass.typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
.checked
def SeqLiteral(tpe: Type, elems: List[Tree])(implicit ctx: Context): SeqLiteral = {
@@ -160,7 +160,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
def JavaSeqLiteral(elems: List[Tree])(implicit ctx: Context): SeqLiteral =
new untpd.JavaSeqLiteral(elems)
- .withType(defn.ArrayClass.typeConstructor.appliedTo(ctx.typeComparer.lub(elems.tpes)))
+ .withType(defn.ArrayClass.typeRef.appliedTo(ctx.typeComparer.lub(elems.tpes)))
.checked
def TypeTree(original: Tree)(implicit ctx: Context): TypeTree =
@@ -225,7 +225,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
val (tparams, mtp) = sym.info match {
case tp: PolyType =>
val tparams = ctx.newTypeParams(sym, tp.paramNames, EmptyFlags, tp.instantiateBounds)
- (tparams, tp.instantiate(tparams map (_.typeConstructor)))
+ (tparams, tp.instantiate(tparams map (_.typeRef)))
case tp => (Nil, tp)
}
@@ -346,7 +346,7 @@ object tpd extends Trees.Instance[Type] with TypedTreeInfo {
val modcls = sym.moduleClass.asClass
val constr = DefDef(modcls.primaryConstructor.asTerm, EmptyTree)
val clsdef = ClassDef(modcls, constr, body)
- val valdef = ValDef(sym, New(modcls.typeConstructor))
+ val valdef = ValDef(sym, New(modcls.typeRef))
Thicket(valdef, clsdef)
}
diff --git a/src/dotty/tools/dotc/ast/UntypedTrees.scala b/src/dotty/tools/dotc/ast/UntypedTrees.scala
index c5a41661e..774f24394 100644
--- a/src/dotty/tools/dotc/ast/UntypedTrees.scala
+++ b/src/dotty/tools/dotc/ast/UntypedTrees.scala
@@ -120,7 +120,7 @@ object untpd extends Trees.Instance[Untyped] with TreeInfo[Untyped] {
def ref(tp: NamedType)(implicit ctx: Context): Tree =
TypedSplice(tpd.ref(tp))
- def scalaUnit(implicit ctx: Context) = ref(defn.UnitClass.typeConstructor)
+ def scalaUnit(implicit ctx: Context) = ref(defn.UnitClass.typeRef)
def makeConstructor(mods: Modifiers, tparams: List[TypeDef], vparamss: List[List[ValDef]], rhs: Tree = EmptyTree)(implicit ctx: Context): DefDef =
DefDef(mods, nme.CONSTRUCTOR, tparams, vparamss, TypeTree(), rhs)
diff --git a/src/dotty/tools/dotc/core/Annotations.scala b/src/dotty/tools/dotc/core/Annotations.scala
index 90b916971..6930429b5 100644
--- a/src/dotty/tools/dotc/core/Annotations.scala
+++ b/src/dotty/tools/dotc/core/Annotations.scala
@@ -37,7 +37,7 @@ object Annotations {
apply(cls, arg1 :: arg2 :: Nil)
def apply(cls: ClassSymbol, args: List[Tree])(implicit ctx: Context): Annotation =
- apply(cls.typeConstructor, args)
+ apply(cls.typeRef, args)
def apply(atp: Type, arg: Tree)(implicit ctx: Context): Annotation =
apply(atp, arg :: Nil)
@@ -58,11 +58,11 @@ object Annotations {
apply(defn.AliasAnnot, List(Ident(TermRef.withSig(sym.owner.thisType, sym.name, sym.signature).withDenot(sym))))
def makeChild(sym: Symbol)(implicit ctx: Context) =
- apply(defn.ChildAnnot.typeConstructor.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
+ apply(defn.ChildAnnot.typeRef.appliedTo(sym.owner.thisType.select(sym.name, sym)), Nil)
}
def ThrowsAnnotation(cls: ClassSymbol)(implicit ctx: Context) = {
- val tref = cls.symTypeRef
- Annotation(defn.ThrowsAnnot.typeConstructor.appliedTo(tref), Ident(tref))
+ val tref = cls.typeRef
+ Annotation(defn.ThrowsAnnot.typeRef.appliedTo(tref), Ident(tref))
}
} \ No newline at end of file
diff --git a/src/dotty/tools/dotc/core/Constants.scala b/src/dotty/tools/dotc/core/Constants.scala
index b2949aae7..50bebefe9 100644
--- a/src/dotty/tools/dotc/core/Constants.scala
+++ b/src/dotty/tools/dotc/core/Constants.scala
@@ -54,17 +54,17 @@ object Constants {
def isAnyVal = UnitTag <= tag && tag <= DoubleTag
def tpe(implicit ctx: Context): Type = tag match {
- case UnitTag => defn.UnitClass.typeConstructor
- case BooleanTag => defn.BooleanClass.typeConstructor
- case ByteTag => defn.ByteClass.typeConstructor
- case ShortTag => defn.ShortClass.typeConstructor
- case CharTag => defn.CharClass.typeConstructor
- case IntTag => defn.IntClass.typeConstructor
- case LongTag => defn.LongClass.typeConstructor
- case FloatTag => defn.FloatClass.typeConstructor
- case DoubleTag => defn.DoubleClass.typeConstructor
- case StringTag => defn.StringClass.typeConstructor
- case NullTag => defn.NullClass.typeConstructor
+ case UnitTag => defn.UnitClass.typeRef
+ case BooleanTag => defn.BooleanClass.typeRef
+ case ByteTag => defn.ByteClass.typeRef
+ case ShortTag => defn.ShortClass.typeRef
+ case CharTag => defn.CharClass.typeRef
+ case IntTag => defn.IntClass.typeRef
+ case LongTag => defn.LongClass.typeRef
+ case FloatTag => defn.FloatClass.typeRef
+ case DoubleTag => defn.DoubleClass.typeRef
+ case StringTag => defn.StringClass.typeRef
+ case NullTag => defn.NullClass.typeRef
case ClazzTag => defn.ClassType(typeValue)
case EnumTag => defn.EnumType(symbolValue)
}
diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala
index 9d03d001f..f7f3bde87 100644
--- a/src/dotty/tools/dotc/core/Definitions.scala
+++ b/src/dotty/tools/dotc/core/Definitions.scala
@@ -144,9 +144,9 @@ class Definitions(implicit ctx: Context) {
lazy val NotNullClass = requiredClass("scala.NotNull")
lazy val NothingClass: ClassSymbol = newCompleteClassSymbol(
- ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeConstructor))
+ ScalaPackageClass, tpnme.Nothing, AbstractFinal, List(AnyClass.typeRef))
lazy val NullClass: ClassSymbol = newCompleteClassSymbol(
- ScalaPackageClass, tpnme.Null, AbstractFinal, List(AnyRefAlias.typeConstructor))
+ ScalaPackageClass, tpnme.Null, AbstractFinal, List(AnyRefAlias.typeRef))
lazy val PredefModule = requiredModule("scala.Predef")
lazy val NilModule = requiredModule("scala.collection.immutable.Nil")
@@ -157,7 +157,7 @@ class Definitions(implicit ctx: Context) {
// but does not define it as an explicit class.
newCompleteClassSymbol(
ScalaPackageClass, tpnme.Singleton, Trait | Interface | Final,
- List(AnyClass.typeConstructor), EmptyScope)
+ List(AnyClass.typeRef), EmptyScope)
lazy val SeqClass: ClassSymbol = requiredClass("scala.collection.Seq")
lazy val ArrayClass: ClassSymbol = requiredClass("scala.Array")
lazy val uncheckedStableClass: ClassSymbol = requiredClass("scala.annotation.unchecked.uncheckedStable")
@@ -235,35 +235,35 @@ class Definitions(implicit ctx: Context) {
def methOfAnyRef(tp: Type) = MethodType(List(AnyRefType), tp)
// Derived types
- def AnyType: Type = AnyClass.typeConstructor
- def AnyValType: Type = AnyValClass.typeConstructor
- def ObjectType: Type = ObjectClass.typeConstructor
- def AnyRefType: Type = AnyRefAlias.typeConstructor
- def NotNullType: Type = NotNullClass.typeConstructor
- def NothingType: Type = NothingClass.typeConstructor
- def NullType: Type = NullClass.typeConstructor
- def SeqType: Type = SeqClass.typeConstructor
- def ArrayType: Type = ArrayClass.typeConstructor
+ def AnyType: Type = AnyClass.typeRef
+ def AnyValType: Type = AnyValClass.typeRef
+ def ObjectType: Type = ObjectClass.typeRef
+ def AnyRefType: Type = AnyRefAlias.typeRef
+ def NotNullType: Type = NotNullClass.typeRef
+ def NothingType: Type = NothingClass.typeRef
+ def NullType: Type = NullClass.typeRef
+ def SeqType: Type = SeqClass.typeRef
+ def ArrayType: Type = ArrayClass.typeRef
def ObjectArrayType = ArrayType.appliedTo(ObjectType)
- def UnitType: Type = UnitClass.typeConstructor
- def BooleanType: Type = BooleanClass.typeConstructor
- def ByteType: Type = ByteClass.typeConstructor
- def ShortType: Type = ShortClass.typeConstructor
- def CharType: Type = CharClass.typeConstructor
- def IntType: Type = IntClass.typeConstructor
- def LongType: Type = LongClass.typeConstructor
- def FloatType: Type = FloatClass.typeConstructor
- def DoubleType: Type = DoubleClass.typeConstructor
- def PairType: Type = PairClass.typeConstructor
- def StringType: Type = StringClass.typeConstructor
- def RepeatedParamType = RepeatedParamClass.typeConstructor
- def JavaRepeatedParamType = JavaRepeatedParamClass.typeConstructor
- def ThrowableType = ThrowableClass.typeConstructor
- def OptionType = OptionClass.typeConstructor
+ def UnitType: Type = UnitClass.typeRef
+ def BooleanType: Type = BooleanClass.typeRef
+ def ByteType: Type = ByteClass.typeRef
+ def ShortType: Type = ShortClass.typeRef
+ def CharType: Type = CharClass.typeRef
+ def IntType: Type = IntClass.typeRef
+ def LongType: Type = LongClass.typeRef
+ def FloatType: Type = FloatClass.typeRef
+ def DoubleType: Type = DoubleClass.typeRef
+ def PairType: Type = PairClass.typeRef
+ def StringType: Type = StringClass.typeRef
+ def RepeatedParamType = RepeatedParamClass.typeRef
+ def JavaRepeatedParamType = JavaRepeatedParamClass.typeRef
+ def ThrowableType = ThrowableClass.typeRef
+ def OptionType = OptionClass.typeRef
def ClassType(arg: Type)(implicit ctx: Context) = {
- val ctype = ClassClass.typeConstructor
+ val ctype = ClassClass.typeRef
if (ctx.phase.erasedTypes) ctype else ctype.appliedTo(arg)
}
@@ -273,11 +273,11 @@ class Definitions(implicit ctx: Context) {
// - sym: the symbol of the actual enumeration value (VAL1)
// - .owner: the ModuleClassSymbol of the enumeration (object E)
// - .linkedClass: the ClassSymbol of the enumeration (class E)
- sym.owner.linkedClass.typeConstructor
+ sym.owner.linkedClass.typeRef
object FunctionType {
def apply(args: List[Type], resultType: Type) =
- FunctionClass(args.length).typeConstructor.appliedTo(args :+ resultType)
+ FunctionClass(args.length).typeRef.appliedTo(args :+ resultType)
def unapply(ft: Type) = {
val tsym = ft.typeSymbol
lazy val targs = ft.typeArgs
@@ -362,7 +362,7 @@ class Definitions(implicit ctx: Context) {
val paramDecls = newScope
for ((v, i) <- vcs.zipWithIndex)
newTypeParam(cls, tpnme.higherKindedParamName(i), varianceFlags(v), paramDecls)
- denot.info = ClassInfo(ScalaPackageClass.thisType, cls, List(ObjectClass.typeConstructor), paramDecls)
+ denot.info = ClassInfo(ScalaPackageClass.thisType, cls, List(ObjectClass.typeRef), paramDecls)
}
}
@@ -657,8 +657,8 @@ class Definitions(implicit ctx: Context) {
// convenient one-argument parameter lists
lazy val anyparam = List(AnyClass.tpe)
- lazy val anyvalparam = List(AnyValClass.typeConstructor)
- lazy val anyrefparam = List(AnyRefClass.typeConstructor)
+ lazy val anyvalparam = List(AnyValClass.typeRef)
+ lazy val anyrefparam = List(AnyRefClass.typeRef)
// private parameter conveniences
private def booltype = BooleanClass.tpe
@@ -1205,7 +1205,7 @@ class Definitions(implicit ctx: Context) {
/** Given type U, creates a Type representing Class[_ <: U].
*/
def boundedClassType(upperBound: Type) =
- appliedTypeAsUpperBounds(ClassClass.typeConstructor, List(upperBound))
+ appliedTypeAsUpperBounds(ClassClass.typeRef, List(upperBound))
/** To avoid unchecked warnings on polymorphic classes, translate
* a Foo[T] into a Foo[_] for use in the pattern matcher.
@@ -1262,7 +1262,7 @@ class Definitions(implicit ctx: Context) {
// java.lang.Object. Java also special cases the return type.
lazy val Any_getClass = enterNewMethod(AnyClass, nme.getClass_, Nil, requiredMethod(ObjectClass, nme.getClass_).tpe.resultType, DEFERRED)
lazy val Any_isInstanceOf = newT1NullaryMethod(AnyClass, nme.isInstanceOf_, Final)(_ => BooleanType)
- lazy val Any_asInstanceOf = newT1NullaryMethod(AnyClass, nme.asInstanceOf_, Final)(_.typeConstructor)
+ lazy val Any_asInstanceOf = newT1NullaryMethod(AnyClass, nme.asInstanceOf_, Final)(_.typeRef)
// A type function from T => Class[U], used to determine the return
// type of getClass calls. The returned type is:
@@ -1692,7 +1692,7 @@ class Definitions(implicit ctx: Context) {
// TODO: set type bounds manually (-> MulticastDelegate), see newTypeParam
val newCaller = enterNewMethod(DelegateClass, name, paramTypes, delegateType, Final | STATIC)
// val newCaller = newPolyMethod(DelegateClass, name,
- // tparam => MethodType(paramTypes, tparam.typeConstructor)) setFlag (Final | STATIC)
+ // tparam => MethodType(paramTypes, tparam.typeRef)) setFlag (Final | STATIC)
Delegate_scalaCallers = Delegate_scalaCallers ::: List(newCaller)
nbScalaCallers += 1
newCaller
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index de4a1d8e3..2e90f3170 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -634,7 +634,7 @@ object SymDenotations {
/** The named typeref representing the type constructor for this type.
* @throws ClassCastException is this is not a type
*/
- def typeConstructor(implicit ctx: Context): TypeRef =
+ def typeRef(implicit ctx: Context): TypeRef =
if ((this is PackageClass) || owner.isTerm) symTypeRef
else TypeRef(owner.thisType, name.asTypeName).withDenot(this)
@@ -779,8 +779,8 @@ object SymDenotations {
private[this] var myTypeConstructor: TypeRef = null
- override def typeConstructor(implicit ctx: Context): TypeRef = {
- if (myTypeConstructor == null) myTypeConstructor = super.typeConstructor
+ override def typeRef(implicit ctx: Context): TypeRef = {
+ if (myTypeConstructor == null) myTypeConstructor = super.typeRef
myTypeConstructor
}
@@ -1003,7 +1003,7 @@ object SymDenotations {
ctx.debugTraceIndented(s"$tp.baseType($this)") {
if (symbol.isStatic && tp.derivesFrom(symbol))
- symbol.typeConstructor
+ symbol.typeRef
else tp match {
case tp: CachedType =>
if (baseTypeValid != ctx.runId) {
diff --git a/src/dotty/tools/dotc/core/Symbols.scala b/src/dotty/tools/dotc/core/Symbols.scala
index 7869f75b9..e18286426 100644
--- a/src/dotty/tools/dotc/core/Symbols.scala
+++ b/src/dotty/tools/dotc/core/Symbols.scala
@@ -206,7 +206,7 @@ trait Symbols { this: Context =>
/** Create a class constructor symbol for given class `cls`. */
def newConstructor(cls: ClassSymbol, flags: FlagSet, paramNames: List[TermName], paramTypes: List[Type], privateWithin: Symbol = NoSymbol, coord: Coord = NoCoord) =
- newSymbol(cls, nme.CONSTRUCTOR, flags | Method, MethodType(paramNames, paramTypes)(_ => cls.typeConstructor), privateWithin, coord)
+ newSymbol(cls, nme.CONSTRUCTOR, flags | Method, MethodType(paramNames, paramTypes)(_ => cls.typeRef), privateWithin, coord)
/** Create an empty default constructor symbol for given class `cls`. */
def newDefaultConstructor(cls: ClassSymbol) =
@@ -463,7 +463,7 @@ object Symbols {
override def superId(implicit ctx: Context): Int = {
val hint = superIdHint
- val key = this.typeConstructor
+ val key = this.typeRef
if (hint >= 0 && hint <= ctx.lastSuperId && (ctx.classOfId(hint) eq key))
hint
else {
diff --git a/src/dotty/tools/dotc/core/TypeComparer.scala b/src/dotty/tools/dotc/core/TypeComparer.scala
index b1081e433..b554e0bea 100644
--- a/src/dotty/tools/dotc/core/TypeComparer.scala
+++ b/src/dotty/tools/dotc/core/TypeComparer.scala
@@ -333,7 +333,7 @@ class TypeComparer(initctx: Context) extends DotClass {
((v > 0) || (lo2 isRef NothingClass) || isSubType(lo2, lo1)) &&
((v < 0) || (hi2 isRef AnyClass) || isSubType(hi1, hi2))
case tp1: ClassInfo =>
- val tt = tp1.typeConstructor // was typeTemplate
+ val tt = tp1.typeRef
isSubType(lo2, tt) && isSubType(tt, hi2)
case _ =>
false
diff --git a/src/dotty/tools/dotc/core/TypeOps.scala b/src/dotty/tools/dotc/core/TypeOps.scala
index c48a8e715..cdc695ebd 100644
--- a/src/dotty/tools/dotc/core/TypeOps.scala
+++ b/src/dotty/tools/dotc/core/TypeOps.scala
@@ -146,7 +146,7 @@ trait TypeOps { this: Context =>
case tp: TypeRef =>
tp
case ErrorType =>
- defn.AnyClass.typeConstructor
+ defn.AnyClass.typeRef
case _ =>
throw new TypeError(s"unexpected parent type: $tp")
}
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 916f2cdc6..5617fa6cc 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -731,7 +731,7 @@ object Types {
/** This type seen as a TypeBounds */
final def bounds(implicit ctx: Context): TypeBounds = this match {
case tp: TypeBounds => tp
- case ci: ClassInfo => TypeAlias(ci.typeConstructor)
+ case ci: ClassInfo => TypeAlias(ci.typeRef)
case wc: WildcardType =>
wc.optBounds match {
case bounds: TypeBounds => bounds
@@ -961,7 +961,7 @@ object Types {
*/
def translateParameterized(from: ClassSymbol, to: ClassSymbol)(implicit ctx: Context): Type =
if (this derivesFrom from)
- RefinedType(to.typeConstructor, to.typeParams.head.name, member(from.typeParams.head.name).info)
+ RefinedType(to.typeRef, to.typeParams.head.name, member(from.typeParams.head.name).info)
else this
/** If this is an encoding of a (partially) applied type, return its arguments,
@@ -2080,7 +2080,7 @@ object Types {
selfInfo: DotClass /* should be: Type | Symbol */) extends CachedGroundType with TypeType {
def selfType(implicit ctx: Context): Type = selfInfo match {
- case NoType => cls.typeConstructor
+ case NoType => cls.typeRef
case self: Symbol => self.info
case tp: Type => tp
}
@@ -2091,7 +2091,7 @@ object Types {
private var tyconCache: Type = null
- def typeConstructor(implicit ctx: Context): Type = {
+ def typeRef(implicit ctx: Context): Type = {
def clsDenot = if (prefix eq cls.owner.thisType) cls.denot else cls.denot.copySymDenotation(info = this)
if (tyconCache == null)
tyconCache =
@@ -2195,7 +2195,7 @@ object Types {
* @see Definitions.hkTrait
*/
def higherKinded(boundSyms: List[Symbol])(implicit ctx: Context) = {
- val parent = defn.hkTrait(boundSyms map (_.variance)).typeConstructor
+ val parent = defn.hkTrait(boundSyms map (_.variance)).typeRef
val hkParamNames = boundSyms.indices.toList map tpnme.higherKindedParamName
def substBoundSyms(tp: Type)(rt: RefinedType): Type =
tp.subst(boundSyms, hkParamNames map (TypeRef(RefinedThis(rt), _)))
@@ -2311,7 +2311,7 @@ object Types {
case _ => false
}
val noParamsNeeded = (tp.cls is Trait) || zeroParams(tp.cls.primaryConstructor.info)
- val selfTypeFeasible = tp.typeConstructor <:< tp.selfType
+ val selfTypeFeasible = tp.typeRef <:< tp.selfType
noParamsNeeded && selfTypeFeasible
case tp: RefinedType =>
isInstantiatable(tp.underlying)
diff --git a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
index a641e10cc..b68f9eb6f 100644
--- a/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
+++ b/src/dotty/tools/dotc/core/pickling/ClassfileParser.scala
@@ -101,11 +101,11 @@ class ClassfileParser(
/** Parse parents for Java classes. For Scala, return AnyRef, since the real type will be unpickled.
* Updates the read pointer of 'in'. */
def parseParents: List[Type] = {
- val superType = if (isAnnotation) { in.nextChar; defn.AnnotationClass.typeConstructor }
- else pool.getSuperClass(in.nextChar).typeConstructor
+ val superType = if (isAnnotation) { in.nextChar; defn.AnnotationClass.typeRef }
+ else pool.getSuperClass(in.nextChar).typeRef
val ifaceCount = in.nextChar
- var ifaces = for (i <- List.range(0, ifaceCount)) yield pool.getSuperClass(in.nextChar).typeConstructor
- if (isAnnotation) ifaces = defn.ClassfileAnnotationClass.typeConstructor :: ifaces
+ var ifaces = for (i <- List.range(0, ifaceCount)) yield pool.getSuperClass(in.nextChar).typeRef
+ if (isAnnotation) ifaces = defn.ClassfileAnnotationClass.typeRef :: ifaces
superType :: ifaces
}
@@ -190,7 +190,7 @@ class ClassfileParser(
*/
def normalizeConstructorInfo() = {
val mt @ MethodType(paramnames, paramtypes) = denot.info
- val rt = classRoot.typeConstructor appliedTo (classRoot.typeParams map (_.symRef))
+ val rt = classRoot.typeRef appliedTo (classRoot.typeParams map (_.symRef))
denot.info = mt.derivedMethodType(paramnames, paramtypes, rt)
addConstructorTypeParams(denot)
}
@@ -283,12 +283,12 @@ class ClassfileParser(
}
val classSym = classNameToSymbol(subName(c => c == ';' || c == '<'))
- var tpe = processClassType(processInner(classSym.typeConstructor))
+ var tpe = processClassType(processInner(classSym.typeRef))
while (sig(index) == '.') {
accept('.')
val name = subName(c => c == ';' || c == '<' || c == '.').toTypeName
val clazz = tpe.member(name).symbol
- tpe = processClassType(processInner(clazz.typeConstructor))
+ tpe = processClassType(processInner(clazz.typeRef))
}
accept(';')
tpe
@@ -321,7 +321,7 @@ class ClassfileParser(
val n = subName(';'.==).toTypeName
index += 1
//assert(tparams contains n, s"classTparams = $classTParams, tparams = $tparams, key = $n")
- if (skiptvs) defn.AnyType else tparams(n).typeConstructor
+ if (skiptvs) defn.AnyType else tparams(n).typeRef
}
} // sig2type(tparams, skiptvs)
@@ -867,11 +867,11 @@ class ClassfileParser(
} else {
val sym = classNameToSymbol(name)
values(index) = sym
- c = sym.typeConstructor
+ c = sym.typeRef
}
} else c = value match {
case tp: Type => tp
- case cls: Symbol => cls.typeConstructor
+ case cls: Symbol => cls.typeRef
}
c
}
@@ -907,7 +907,7 @@ class ClassfileParser(
}
value match {
case ct: Constant => ct
- case cls: Symbol => Constant(cls.typeConstructor)
+ case cls: Symbol => Constant(cls.typeRef)
case arr: Type => Constant(arr)
}
}
diff --git a/src/dotty/tools/dotc/core/pickling/UnPickler.scala b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
index 386ea3d85..02db4b0b0 100644
--- a/src/dotty/tools/dotc/core/pickling/UnPickler.scala
+++ b/src/dotty/tools/dotc/core/pickling/UnPickler.scala
@@ -781,7 +781,7 @@ class UnPickler(bytes: Array[Byte], classRoot: ClassDenotation, moduleClassRoot:
val end = readNat() + readIndex
// array elements are trees representing instances of scala.annotation.Annotation
SeqLiteral(
- defn.SeqType.appliedTo(defn.AnnotationClass.typeConstructor :: Nil),
+ defn.SeqType.appliedTo(defn.AnnotationClass.typeRef :: Nil),
until(end, () => readClassfileAnnotArg(readNat())))
}
diff --git a/src/dotty/tools/dotc/core/transform/Erasure.scala b/src/dotty/tools/dotc/core/transform/Erasure.scala
index 119400fdb..03726e4f5 100644
--- a/src/dotty/tools/dotc/core/transform/Erasure.scala
+++ b/src/dotty/tools/dotc/core/transform/Erasure.scala
@@ -37,7 +37,7 @@ object Erasure {
val sym = tp.symbol
if (sym.isClass)
/*if (sym.isDerivedValueClass) eraseDerivedValueClassRef(tref)
- else */if (sym.owner is Package) normalizeClass(sym.asClass).typeConstructor
+ else */if (sym.owner is Package) normalizeClass(sym.asClass).typeRef
else tp.derivedSelect(erasure(tp.prefix))
else erasure(tp.info)
case tp: RefinedType =>
@@ -60,7 +60,7 @@ object Erasure {
case tp @ ClassInfo(pre, cls, classParents, decls, _) =>
val parents: List[TypeRef] =
if (cls == defn.ObjectClass || cls.isPrimitiveValueClass) Nil
- else if (cls == defn.ArrayClass) defn.ObjectClass.typeConstructor :: Nil
+ else if (cls == defn.ArrayClass) defn.ObjectClass.typeRef :: Nil
else removeLaterObjects(classParents mapConserve (erasure(_).asInstanceOf[TypeRef]))
tp.derivedClassInfo(erasure(pre), parents, NoType)
case ErrorType =>
diff --git a/src/dotty/tools/dotc/parsing/TreeBuilder.scala.unused b/src/dotty/tools/dotc/parsing/TreeBuilder.scala.unused
index 12377ca94..672c85179 100644
--- a/src/dotty/tools/dotc/parsing/TreeBuilder.scala.unused
+++ b/src/dotty/tools/dotc/parsing/TreeBuilder.scala.unused
@@ -434,7 +434,7 @@ class TreeBuilder(implicit ctx: Context) {
}
def mkAnnotated(cls: Symbol, tree: Tree) =
- Annotated(TypedSplice(tpd.New(cls.typeConstructor)), tree)
+ Annotated(TypedSplice(tpd.New(cls.typeRef)), tree)
/** Create visitor <x => x match cases> */
def makeVisitor(cases: List[CaseDef], checkExhaustive: Boolean, canDrop: Boolean = false): Tree = {
diff --git a/src/dotty/tools/dotc/typer/Namer.scala b/src/dotty/tools/dotc/typer/Namer.scala
index 62405abd9..c8cc7452c 100644
--- a/src/dotty/tools/dotc/typer/Namer.scala
+++ b/src/dotty/tools/dotc/typer/Namer.scala
@@ -423,7 +423,7 @@ class Namer { typer: Typer =>
if (isConstructor) {
// set result type tree to unit, but set the current class as result type of the symbol
typedAheadType(ddef.tpt, defn.UnitType)
- wrapMethType(sym.owner.typeConstructor.appliedTo(typeParams map (_.symRef)))
+ wrapMethType(sym.owner.typeRef.appliedTo(typeParams map (_.symRef)))
}
else valOrDefDefSig(ddef, sym, wrapMethType)
}
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala
index 4242b5c99..54e105238 100644
--- a/src/dotty/tools/dotc/typer/Typer.scala
+++ b/src/dotty/tools/dotc/typer/Typer.scala
@@ -472,7 +472,7 @@ class Typer extends Namer with Applications with Implicits {
val untpd.Function(args, body) = tree
if (ctx.mode is Mode.Type)
typed(cpy.AppliedTypeTree(tree,
- ref(defn.FunctionClass(args.length).typeConstructor), args :+ body), pt)
+ ref(defn.FunctionClass(args.length).typeRef), args :+ body), pt)
else {
val params = args.asInstanceOf[List[ValDef]]
val protoFormals: List[Type] = pt match {
@@ -710,7 +710,7 @@ class Typer extends Namer with Applications with Implicits {
}
def typedAnnotation(annot: untpd.Tree)(implicit ctx: Context): Tree = track("typedAnnotation") {
- typed(annot, defn.AnnotationClass.typeConstructor)
+ typed(annot, defn.AnnotationClass.typeRef)
}
def typedValDef(vdef: untpd.ValDef, sym: Symbol)(implicit ctx: Context) = track("typedValDef") {
@@ -768,7 +768,7 @@ class Typer extends Namer with Applications with Implicits {
}
def typedAnnotated(tree: untpd.Annotated, pt: Type)(implicit ctx: Context): Tree = track("typedAnnotated") {
- val annot1 = typed(tree.annot, defn.AnnotationClass.typeConstructor)
+ val annot1 = typed(tree.annot, defn.AnnotationClass.typeRef)
val arg1 = typed(tree.arg, pt)
val ownType = AnnotatedType(Annotation(annot1), arg1.tpe)
if (ctx.mode is Mode.Type)
diff --git a/test/test/baseTypetest.sc b/test/test/baseTypetest.sc
index 350e503aa..001f1e3b3 100644
--- a/test/test/baseTypetest.sc
+++ b/test/test/baseTypetest.sc
@@ -8,20 +8,19 @@ import Types._, Symbols._
object baseTypetest extends DottyTest {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
val int = defn.IntType //> int : dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class scal
- //| a),Int)
- int.baseClasses //> res0: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class Int, clas
- //| s AnyVal, class NotNull, class Any)
- defn.StringClass.typeConstructor.baseClasses //> res1: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class String, c
- //| lass CharSequence, class Comparable, class Serializable, class Object, class
- //| Any)
- defn.StringClass.typeConstructor.baseType(defn.ObjectClass)
- //> res2: dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class lang)
- //| ,Object)
- defn.StringClass.typeConstructor.baseType(defn.AnyClass)
- //> res3: dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class scala
- //| ),Any)
+ //| a#35),Int)
+ int.baseClasses //> res0: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class Int#1364,
+ //| class AnyVal#575, class Any#2133)
+ defn.StringClass.typeRef.baseClasses //> res1: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class String#21
+ //| 3, class CharSequence#531, class Comparable#102, class Serializable#3816, cl
+ //| ass Object#129, class Any#2133)
+ defn.StringClass.typeRef.baseType(defn.ObjectClass)
+ //> res2: dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class lang#
+ //| 57),Object)
+ defn.StringClass.typeRef.baseType(defn.AnyClass)//> res3: dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class scala
+ //| #35),Any)
defn.StringClass isSubClass defn.NullClass //> res4: Boolean = false
- defn.StringClass.typeConstructor.baseType(defn.NullClass)
+ defn.StringClass.typeRef.baseType(defn.NullClass)
//> res5: dotty.tools.dotc.core.Types.Type = NoType
} \ No newline at end of file
diff --git a/test/test/denotTest.sc b/test/test/denotTest.sc
index 939c51c01..222a347b6 100644
--- a/test/test/denotTest.sc
+++ b/test/test/denotTest.sc
@@ -8,48 +8,48 @@ import Types._, Symbols._
object denotTest extends DottyTest {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
- val str = defn.StringClass.typeConstructor //> str : dotty.tools.dotc.core.Types.TypeRef = TypeRef(ThisType(module class l
- //| ang),String)
+ val str = defn.StringClass.typeRef //> str : dotty.tools.dotc.core.Types.TypeRef = TypeRef(ThisType(module class l
+ //| ang#57),String)
val d= str.member("getBytes".toTermName) //> d : dotty.tools.dotc.core.Denotations.Denotation = val getBytes <and> val g
//| etBytes <and> val getBytes <and> val getBytes
d.alternatives //> res0: List[dotty.tools.dotc.core.Denotations.SingleDenotation] = List(val ge
//| tBytes, val getBytes, val getBytes, val getBytes)
d.alternatives.map(_.info) //> res1: List[dotty.tools.dotc.core.Types.Type] = List(JavaMethodType(List(), L
- //| ist(), RefinedType(TypeRef(ThisType(module class scala),Array), scala$Array$
- //| $T, TypeAlias(TypeRef(ThisType(module class scala),Byte)) | hash = 777673561
- //| )), JavaMethodType(List(x$0), List(TypeRef(ThisType(module class charset),Ch
- //| arset)), RefinedType(TypeRef(ThisType(module class scala),Array), scala$Arra
- //| y$$T, TypeAlias(TypeRef(ThisType(module class scala),Byte)) | hash = 7776735
- //| 61)), JavaMethodType(List(x$0), List(TypeRef(ThisType(module class lang),Str
- //| ing)), RefinedType(TypeRef(ThisType(module class scala),Array), scala$Array$
- //| $T, TypeAlias(TypeRef(ThisType(module class scala),Byte)) | hash = 777673561
- //| )), JavaMethodType(List(x$0, x$1, x$2, x$3), List(TypeRef(ThisType(module cl
- //| ass scala),Int), TypeRef(ThisType(module class scala),Int), RefinedType(Type
- //| Ref(ThisType(module class scala),Array), scala$Array$$T, TypeAlias(TypeRef(T
- //| hisType(module class scala),Byte)) | hash = 777673561), TypeRef(ThisType(mod
- //| ule class scala),Int)), TypeRef(ThisType(module class scala),Unit)))
- val sm = defn.StringClass.companionModule //> sm : dotty.tools.dotc.core.Symbols.Symbol = module String
+ //| ist(), RefinedType(TypeRef(ThisType(module class scala#35),Array), scala$Arr
+ //| ay$$T, TypeAlias(TypeRef(ThisType(module class scala#35),Byte)))), JavaMetho
+ //| dType(List(x$0), List(TypeRef(ThisType(module class charset#5432),Charset)),
+ //| RefinedType(TypeRef(ThisType(module class scala#35),Array), scala$Array$$T,
+ //| TypeAlias(TypeRef(ThisType(module class scala#35),Byte)))), JavaMethodType(
+ //| List(x$0), List(TypeRef(ThisType(module class lang#57),String)), RefinedType
+ //| (TypeRef(ThisType(module class scala#35),Array), scala$Array$$T, TypeAlias(T
+ //| ypeRef(ThisType(module class scala#35),Byte)))), JavaMethodType(List(x$0, x$
+ //| 1, x$2, x$3), List(TypeRef(ThisType(module class scala#35),Int), TypeRef(Thi
+ //| sType(module class scala#35),Int), RefinedType(TypeRef(ThisType(module class
+ //| scala#35),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(module class s
+ //| cala#35),Byte))), TypeRef(ThisType(module class scala#35),Int)), TypeRef(Thi
+ //| sType(module class scala#35),Unit)))
+ val sm = defn.StringClass.companionModule //> sm : dotty.tools.dotc.core.Symbols.Symbol = module String#214
val d2 = sm.info.member("valueOf".toTermName) //> d2 : dotty.tools.dotc.core.Denotations.Denotation = val valueOf <and> val v
//| alueOf <and> val valueOf <and> val valueOf <and> val valueOf <and> val value
//| Of <and> val valueOf <and> val valueOf <and> val valueOf
d2.alternatives.map(_.info) //> res2: List[dotty.tools.dotc.core.Types.Type] = List(JavaMethodType(List(x$0)
- //| , List(TypeRef(ThisType(module class scala),Double)), TypeRef(ThisType(modul
- //| e class lang),String)), JavaMethodType(List(x$0), List(TypeRef(ThisType(modu
- //| le class scala),Float)), TypeRef(ThisType(module class lang),String)), JavaM
- //| ethodType(List(x$0), List(TypeRef(ThisType(module class scala),Long)), TypeR
- //| ef(ThisType(module class lang),String)), JavaMethodType(List(x$0), List(Type
- //| Ref(ThisType(module class scala),Int)), TypeRef(ThisType(module class lang),
+ //| , List(TypeRef(ThisType(module class scala#35),Double)), TypeRef(ThisType(mo
+ //| dule class lang#57),String)), JavaMethodType(List(x$0), List(TypeRef(ThisTyp
+ //| e(module class scala#35),Float)), TypeRef(ThisType(module class lang#57),Str
+ //| ing)), JavaMethodType(List(x$0), List(TypeRef(ThisType(module class scala#35
+ //| ),Long)), TypeRef(ThisType(module class lang#57),String)), JavaMethodType(Li
+ //| st(x$0), List(TypeRef(ThisType(module class scala#35),Int)), TypeRef(ThisTyp
+ //| e(module class lang#57),String)), JavaMethodType(List(x$0), List(TypeRef(Thi
+ //| sType(module class scala#35),Char)), TypeRef(ThisType(module class lang#57),
//| String)), JavaMethodType(List(x$0), List(TypeRef(ThisType(module class scala
- //| ),Char)), TypeRef(ThisType(module class lang),String)), JavaMethodType(List(
- //| x$0), List(TypeRef(ThisType(module class scala),Boolean)), TypeRef(ThisType(
- //| module class lang),String)), JavaMethodType(List(x$0, x$1, x$2), List(Refine
- //| dType(TypeRef(ThisType(module class scala),Array), scala$Array$$T, TypeAlias
- //| (TypeRef(ThisType(module class scala),Char)) | hash = 2075434073), TypeRef(T
- //| hisType(module class scala),Int), TypeRef(ThisType(module class scala),Int))
- //| , TypeRef(ThisType(module class lang),String)), JavaMethodType(List(x$0), Li
- //| st(RefinedType(TypeRef(ThisType(module class scala),Array), scala$Array$$T,
- //| TypeAlias(TypeRef(ThisType(module class scala),Char)) | hash = 2075434073)),
- //| TypeRef(ThisType(module class lang),String)), JavaMethodType(List(x$0), Lis
- //| t(TypeRef(ThisType(module class scala),Any)), TypeRef(ThisType(module class
- //| lang),String)))
+ //| #35),Boolean)), TypeRef(ThisType(module class lang#57),String)), JavaMethodT
+ //| ype(List(x$0, x$1, x$2), List(RefinedType(TypeRef(ThisType(module class scal
+ //| a#35),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(module class scala#
+ //| 35),Char))), TypeRef(ThisType(module class scala#35),Int), TypeRef(ThisType(
+ //| module class scala#35),Int)), TypeRef(ThisType(module class lang#57),String)
+ //| ), JavaMethodType(List(x$0), List(RefinedType(TypeRef(ThisType(module class
+ //| scala#35),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(module class sc
+ //| ala#35),Char)))), TypeRef(ThisType(module class lang#57),String)), JavaMetho
+ //| dType(List(x$0), List(TypeRef(ThisType(module class scala#35),Any)), TypeRef
+ //| (ThisType(module class lang#57),String)))
} \ No newline at end of file
diff --git a/test/x/xplore.sc b/test/x/xplore.sc
index 53791d933..15b431637 100644
--- a/test/x/xplore.sc
+++ b/test/x/xplore.sc
@@ -7,64 +7,64 @@ import Decorators._
object xplore {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet
- val c = Main.newCompiler //> c : dotty.tools.dotc.Compiler = dotty.tools.dotc.Compiler@4ac9131c
+ val c = Main.newCompiler //> c : dotty.tools.dotc.Compiler = dotty.tools.dotc.Compiler@36ff057f
val base = new ContextBase //> base : dotty.tools.dotc.core.Contexts.ContextBase = dotty.tools.dotc.core.C
- //| ontexts$ContextBase@72c743eb
+ //| ontexts$ContextBase@2980f96c
implicit val ctx = c.rootContext(base.initialCtx)
//> ctx : dotty.tools.dotc.core.Contexts.Context = dotty.tools.dotc.core.Contex
- //| ts$InitialContext@4f88f506
- val strClass = defn.StringClass //> strClass : dotty.tools.dotc.core.Symbols.ClassSymbol = class String#207
- strClass.baseClasses //> res0: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class String#20
- //| 7, class CharSequence#525, class Comparable#96, class Serializable#3795, cla
- //| ss Object#123, class Any#2112)
- strClass.typeConstructor <:< defn.AnyType //> res1: Boolean = true
- val predef = defn.PredefModule //> predef : dotty.tools.dotc.core.Symbols.TermSymbol = module Predef#1509
+ //| ts$InitialContext@6aadae91
+ val strClass = defn.StringClass //> strClass : dotty.tools.dotc.core.Symbols.ClassSymbol = class String#213
+ strClass.baseClasses //> res0: List[dotty.tools.dotc.core.Symbols.ClassSymbol] = List(class String#21
+ //| 3, class CharSequence#531, class Comparable#102, class Serializable#3816, cl
+ //| ass Object#129, class Any#2133)
+ strClass.typeRef <:< defn.AnyType //> res1: Boolean = true
+ val predef = defn.PredefModule //> predef : dotty.tools.dotc.core.Symbols.TermSymbol = module Predef#1515
val strd = predef.info.member("String".toTypeName)
//> strd : dotty.tools.dotc.core.Denotations.Denotation = type String
strd.info //> res2: dotty.tools.dotc.core.Types.Type = TypeAlias(TypeRef(ThisType(module c
- //| lass lang#51),String))
- val strType = strd.symbol.typeConstructor //> strType : dotty.tools.dotc.core.Types.TypeRef = TypeRef(ThisType(module cla
- //| ss Predef$#1510),String)
+ //| lass lang#57),String))
+ val strType = strd.symbol.typeRef //> strType : dotty.tools.dotc.core.Types.TypeRef = TypeRef(ThisType(module cla
+ //| ss Predef$#1516),String)
strType <:< defn.AnyType //> res3: Boolean = true
- val prdef = defn.PredefModule //> prdef : dotty.tools.dotc.core.Symbols.TermSymbol = module Predef#1509
+ val prdef = defn.PredefModule //> prdef : dotty.tools.dotc.core.Symbols.TermSymbol = module Predef#1515
predef.isCompleted //> res4: Boolean = true
predef.info.parents //> res5: List[dotty.tools.dotc.core.Types.TypeRef] = List(TypeRef(ThisType(modu
- //| le class scala#29),LowPriorityImplicits), TypeRef(ThisType(module class scal
- //| a#29),DeprecatedPredef))
+ //| le class scala#35),LowPriorityImplicits), TypeRef(ThisType(module class scal
+ //| a#35),DeprecatedPredef))
predef.info //> res6: dotty.tools.dotc.core.Types.Type = TypeRef(ThisType(module class scala
- //| #29),Predef$)
- predef.info.typeSymbol //> res7: dotty.tools.dotc.core.Symbols.Symbol = module class Predef$#1510
- val scala = defn.ScalaPackageClass //> scala : dotty.tools.dotc.core.Symbols.ClassSymbol = module class scala#29
+ //| #35),Predef$)
+ predef.info.typeSymbol //> res7: dotty.tools.dotc.core.Symbols.Symbol = module class Predef$#1516
+ val scala = defn.ScalaPackageClass //> scala : dotty.tools.dotc.core.Symbols.ClassSymbol = module class scala#35
scala.info.decl("Predef$".toTypeName) //> res8: dotty.tools.dotc.core.Denotations.Denotation = module class Predef$
- predef.info.decls //> res9: dotty.tools.dotc.core.Scopes.Scope = Scopes(val <init>#4952, val class
- //| Of#4953, type Class#4954, type String#4957, type Function#4958, type Map#496
- //| 1, type Set#4964, val Map#4966, val Map #4967, val Set#4968, val Set #4969,
- //| type ClassManifest#4970, type OptManifest#4972, type Manifest#4974, val Clas
- //| sManifest#4976, val ClassManifest #4977, val Manifest#4978, val Manifest #49
- //| 79, val NoManifest#4980, val NoManifest #4981, val manifest#4982, val classM
- //| anifest#4985, val optManifest#4988, val identity#4991, val implicitly#4994,
- //| val locally#4997, val error#5000, val assert#5002, val assert#5004, val assu
- //| me#5007, val assume#5009, val require#5012, val require#5014, val $qmark$qma
- //| rk$qmark#5017, type Pair#5018, module Pair#5021, type Triple#5033, module Tr
- //| iple#5037, class ArrowAssoc#5052, val ArrowAssoc#5067, class Ensuring#5070,
- //| val Ensuring#5089, class StringFormat#5092, val StringFormat#5103, class Str
- //| ingAdd#5106, val StringAdd#5117, class RichException#5120, val RichException
- //| #5129, class SeqCharSequence#5131, val SeqCharSequence#5143, class ArrayChar
- //| Sequence#5145, val ArrayCharSequence#5157, val StringCanBuildFrom#5159, val
- //| StringCanBuildFrom #5160, val augmentString#5161, val unaugmentString#5163,
- //| val print#5165, val println#5167, val println#5168, val printf#5170, val tup
- //| le2ToZippedOps#5173, val tuple3ToZippedOps#5177, val genericArrayOps#5182, v
- //| al booleanArrayOps#5185, val byteArrayOps#5187, val charArrayOps#5189, val d
- //| oubleArrayOps#5191, val floatArrayOps#5193, val intArrayOps#5195, val longAr
- //| rayOps#5197, val refArrayOps#5199, val shortArrayOps#5202, val unitArrayOps#
- //| 5204, val byte2Byte#5206, val short2Short#5208, val char2Character#5210, val
- //| int2Integer#5212, val long2Long#5214, val float2Float#5216, val double2Doub
- //| le#5218, val boolean2Boolean#5220, val Byte2byte#5222, val Short2short#5224,
- //| val Character2char#5226, val Integer2int#5228, val Long2long#5230, val Floa
- //| t2float#5232, val Double2double#5234, val Boolean2boolean#5236, class $less$
- //| colon$less#5238, val singleton_$less$colon$less#5243, val conforms#5244, cla
- //| ss $eq$colon$eq#5246, val singleton_$eq$colon$eq#5251, module $eq$colon$eq#5
- //| 252, class DummyImplicit#5258, module DummyImplicit#5260, module RichExcepti
- //| on#5264, module StringAdd#5274, module StringFormat#5288, module Ensuring#53
- //| 02, module ArrowAssoc#5330)
+ predef.info.decls //> res9: dotty.tools.dotc.core.Scopes.Scope = Scopes(val <init>#4979, val class
+ //| Of#4980, type Class#4981, type String#4984, type Function#4985, type Map#498
+ //| 8, type Set#4991, val Map#4993, val Map #4994, val Set#4995, val Set #4996,
+ //| type ClassManifest#4997, type OptManifest#4999, type Manifest#5001, val Clas
+ //| sManifest#5003, val ClassManifest #5004, val Manifest#5005, val Manifest #50
+ //| 06, val NoManifest#5007, val NoManifest #5008, val manifest#5009, val classM
+ //| anifest#5012, val optManifest#5015, val identity#5018, val implicitly#5021,
+ //| val locally#5024, val error#5027, val assert#5029, val assert#5031, val assu
+ //| me#5034, val assume#5036, val require#5039, val require#5041, val $qmark$qma
+ //| rk$qmark#5044, type Pair#5045, module Pair#5048, type Triple#5060, module Tr
+ //| iple#5064, class ArrowAssoc#5079, val ArrowAssoc#5094, class Ensuring#5097,
+ //| val Ensuring#5116, class StringFormat#5119, val StringFormat#5130, class Str
+ //| ingAdd#5133, val StringAdd#5144, class RichException#5147, val RichException
+ //| #5156, class SeqCharSequence#5158, val SeqCharSequence#5170, class ArrayChar
+ //| Sequence#5172, val ArrayCharSequence#5184, val StringCanBuildFrom#5186, val
+ //| StringCanBuildFrom #5187, val augmentString#5188, val unaugmentString#5190,
+ //| val print#5192, val println#5194, val println#5195, val printf#5197, val tup
+ //| le2ToZippedOps#5200, val tuple3ToZippedOps#5204, val genericArrayOps#5209, v
+ //| al booleanArrayOps#5212, val byteArrayOps#5214, val charArrayOps#5216, val d
+ //| oubleArrayOps#5218, val floatArrayOps#5220, val intArrayOps#5222, val longAr
+ //| rayOps#5224, val refArrayOps#5226, val shortArrayOps#5229, val unitArrayOps#
+ //| 5231, val byte2Byte#5233, val short2Short#5235, val char2Character#5237, val
+ //| int2Integer#5239, val long2Long#5241, val float2Float#5243, val double2Doub
+ //| le#5245, val boolean2Boolean#5247, val Byte2byte#5249, val Short2short#5251,
+ //| val Character2char#5253, val Integer2int#5255, val Long2long#5257, val Floa
+ //| t2float#5259, val Double2double#5261, val Boolean2boolean#5263, class $less$
+ //| colon$less#5265, val singleton_$less$colon$less#5270, val conforms#5271, cla
+ //| ss $eq$colon$eq#5273, val singleton_$eq$colon$eq#5278, module $eq$colon$eq#5
+ //| 279, class DummyImplicit#5285, module DummyImplicit#5287, module RichExcepti
+ //| on#5291, module StringAdd#5301, module StringFormat#5315, module Ensuring#53
+ //| 29, module ArrowAssoc#5357)
} \ No newline at end of file