From 394cc426c1ff1da53146679b4e2995ece52a133e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 21 Dec 2012 12:39:02 -0800 Subject: Fix and simplify typedTypeConstructor. Investigating the useful output of devWarning (-Xdev people, it's good for you) led back to this comment: "normalize to get rid of type aliases" You may know that this is not all the normalizing does. Normalizing also turns TypeRefs with unapplied arguments (type constructors) into PolyTypes. That means that when typedParentType would call typedTypeConstructor it would find its parent had morphed into a PolyType. Not that it noticed; it would blithely continue and unwittingly discard the type arguments by way of appliedType (which smoothly logged the incident, thank you appliedType.) The simplification of typedTypeConstructor: There was a whole complicated special treatment of AnyRef here which appears to have become unnecessary. Removed special treatment and lit a candle for regularity. Updated lots of tests regarding newly not-so-special AnyRef. --- test/files/run/repl-colon-type.check | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/files/run/repl-colon-type.check') diff --git a/test/files/run/repl-colon-type.check b/test/files/run/repl-colon-type.check index 7716221f54..4cd0e1d588 100644 --- a/test/files/run/repl-colon-type.check +++ b/test/files/run/repl-colon-type.check @@ -75,10 +75,10 @@ scala> :type -v List(1,2,3) filter _ // Internal Type structure TypeRef( - TypeSymbol(abstract trait Function1[-T1, +R] extends Object) + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) args = List( TypeRef( - TypeSymbol(abstract trait Function1[-T1, +R] extends Object) + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) args = List( TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) TypeRef( @@ -145,7 +145,7 @@ Int => Iterator[List[Nothing]] // Internal Type structure TypeRef( - TypeSymbol(abstract trait Function1[-T1, +R] extends Object) + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) args = List( TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) TypeRef( @@ -178,7 +178,7 @@ PolyType( typeParams = List(TypeParam(T <: AnyVal)) resultType = NullaryMethodType( TypeRef( - TypeSymbol(abstract trait Function1[-T1, +R] extends Object) + TypeSymbol(abstract trait Function1[-T1, +R] extends AnyRef) args = List( TypeRef(TypeSymbol(final abstract class Int extends AnyVal)) TypeRef( -- cgit v1.2.3