From 70e57128bb7623998f76aaf2ad8541d438b4b2b8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 22 Dec 2013 16:19:09 +0100 Subject: Normalize parents to be class refs Previously, alias type refs were also accepted. But this is the wrong assumption for computeMembersNames. So, e.g. instead of leaving an AnyRef we now expand to Object. Also making ==, != take an Any instead of Object --- src/dotty/tools/dotc/core/Definitions.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/Definitions.scala') diff --git a/src/dotty/tools/dotc/core/Definitions.scala b/src/dotty/tools/dotc/core/Definitions.scala index 96e4f0138..a2527c9f2 100644 --- a/src/dotty/tools/dotc/core/Definitions.scala +++ b/src/dotty/tools/dotc/core/Definitions.scala @@ -45,7 +45,7 @@ class Definitions(implicit ctx: Context) { if (tpe.typeParams.nonEmpty) tpe.appliedTo(typeParam.typeRef) else tpe val parents = parentConstrs.toList map instantiate - val parentRefs: List[TypeRef] = ctx.normalizeToRefs(parents, cls, paramDecls) + val parentRefs: List[TypeRef] = ctx.normalizeToClassRefs(parents, cls, paramDecls) denot.info = ClassInfo(ScalaPackageClass.thisType, cls, parentRefs, paramDecls) } } @@ -98,8 +98,8 @@ class Definitions(implicit ctx: Context) { lazy val AnyRefAlias: TypeSymbol = newAliasType(tpnme.AnyRef, ObjectType) lazy val Object_## = newMethod(ObjectClass, nme.HASHHASH, ExprType(IntType), Final) - lazy val Object_== = newMethod(ObjectClass, nme.EQ, methOfAnyRef(BooleanType), Final) - lazy val Object_!= = newMethod(ObjectClass, nme.NE, methOfAnyRef(BooleanType), Final) + lazy val Object_== = newMethod(ObjectClass, nme.EQ, methOfAny(BooleanType), Final) + lazy val Object_!= = newMethod(ObjectClass, nme.NE, methOfAny(BooleanType), Final) lazy val Object_eq = newMethod(ObjectClass, nme.eq, methOfAnyRef(BooleanType), Final) lazy val Object_ne = newMethod(ObjectClass, nme.ne, methOfAnyRef(BooleanType), Final) lazy val Object_isInstanceOf = newT1EmptyParamsMethod(ObjectClass, nme.isInstanceOf_Ob, _ => BooleanType, Final | Synthetic) -- cgit v1.2.3