diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-21 12:39:02 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-12-28 15:15:52 -0800 |
commit | 394cc426c1ff1da53146679b4e2995ece52a133e (patch) | |
tree | a93bf5d05957f3e6b9100e3365c9a1cf0aa1f181 /test/files/run | |
parent | ed40f5cbdf35d09b02898e9c0950b9bd34c1f858 (diff) | |
download | scala-394cc426c1ff1da53146679b4e2995ece52a133e.tar.gz scala-394cc426c1ff1da53146679b4e2995ece52a133e.tar.bz2 scala-394cc426c1ff1da53146679b4e2995ece52a133e.zip |
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.
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/existentials-in-compiler.check | 104 | ||||
-rw-r--r-- | test/files/run/existentials3-new.check | 4 | ||||
-rw-r--r-- | test/files/run/macro-declared-in-trait.check | 2 | ||||
-rw-r--r-- | test/files/run/reflection-equality.check | 2 | ||||
-rw-r--r-- | test/files/run/repl-colon-type.check | 8 | ||||
-rw-r--r-- | test/files/run/repl-parens.check | 2 | ||||
-rw-r--r-- | test/files/run/t4172.check | 2 | ||||
-rw-r--r-- | test/files/run/t5256a.check | 2 | ||||
-rw-r--r-- | test/files/run/t5256b.check | 2 | ||||
-rw-r--r-- | test/files/run/t5256d.check | 2 | ||||
-rw-r--r-- | test/files/run/t5256e.check | 2 | ||||
-rw-r--r-- | test/files/run/t5256f.check | 4 |
12 files changed, 68 insertions, 68 deletions
diff --git a/test/files/run/existentials-in-compiler.check b/test/files/run/existentials-in-compiler.check index 4df4b0ca96..0d7a9298b4 100644 --- a/test/files/run/existentials-in-compiler.check +++ b/test/files/run/existentials-in-compiler.check @@ -1,156 +1,156 @@ -abstract trait Bippy[A <: AnyRef, B] extends Object +abstract trait Bippy[A <: AnyRef, B] extends AnyRef extest.Bippy[_ <: AnyRef, _] -abstract trait BippyBud[A <: AnyRef, B, C <: List[A]] extends Object +abstract trait BippyBud[A <: AnyRef, B, C <: List[A]] extends AnyRef extest.BippyBud[A,B,C] forSome { A <: AnyRef; B; C <: List[A] } -abstract trait BippyLike[A <: AnyRef, B <: List[A], This <: extest.BippyLike[A,B,This] with extest.Bippy[A,B]] extends Object +abstract trait BippyLike[A <: AnyRef, B <: List[A], This <: extest.BippyLike[A,B,This] with extest.Bippy[A,B]] extends AnyRef extest.BippyLike[A,B,This] forSome { A <: AnyRef; B <: List[A]; This <: extest.BippyLike[A,B,This] with extest.Bippy[A,B] } -abstract trait Contra[-A >: AnyRef, -B] extends Object +abstract trait Contra[-A >: AnyRef, -B] extends AnyRef extest.Contra[_ >: AnyRef, _] -abstract trait ContraLike[-A >: AnyRef, -B >: List[A]] extends Object +abstract trait ContraLike[-A >: AnyRef, -B >: List[A]] extends AnyRef extest.ContraLike[A,B] forSome { -A >: AnyRef; -B >: List[A] } -abstract trait Cov01[+A <: AnyRef, +B] extends Object +abstract trait Cov01[+A <: AnyRef, +B] extends AnyRef extest.Cov01[_ <: AnyRef, _] -abstract trait Cov02[+A <: AnyRef, B] extends Object +abstract trait Cov02[+A <: AnyRef, B] extends AnyRef extest.Cov02[_ <: AnyRef, _] -abstract trait Cov03[+A <: AnyRef, -B] extends Object +abstract trait Cov03[+A <: AnyRef, -B] extends AnyRef extest.Cov03[_ <: AnyRef, _] -abstract trait Cov04[A <: AnyRef, +B] extends Object +abstract trait Cov04[A <: AnyRef, +B] extends AnyRef extest.Cov04[_ <: AnyRef, _] -abstract trait Cov05[A <: AnyRef, B] extends Object +abstract trait Cov05[A <: AnyRef, B] extends AnyRef extest.Cov05[_ <: AnyRef, _] -abstract trait Cov06[A <: AnyRef, -B] extends Object +abstract trait Cov06[A <: AnyRef, -B] extends AnyRef extest.Cov06[_ <: AnyRef, _] -abstract trait Cov07[-A <: AnyRef, +B] extends Object +abstract trait Cov07[-A <: AnyRef, +B] extends AnyRef extest.Cov07[_ <: AnyRef, _] -abstract trait Cov08[-A <: AnyRef, B] extends Object +abstract trait Cov08[-A <: AnyRef, B] extends AnyRef extest.Cov08[_ <: AnyRef, _] -abstract trait Cov09[-A <: AnyRef, -B] extends Object +abstract trait Cov09[-A <: AnyRef, -B] extends AnyRef extest.Cov09[_ <: AnyRef, _] -abstract trait Cov11[+A <: AnyRef, +B <: List[_]] extends Object +abstract trait Cov11[+A <: AnyRef, +B <: List[_]] extends AnyRef extest.Cov11[_ <: AnyRef, _ <: List[_]] -abstract trait Cov12[+A <: AnyRef, B <: List[_]] extends Object +abstract trait Cov12[+A <: AnyRef, B <: List[_]] extends AnyRef extest.Cov12[_ <: AnyRef, _ <: List[_]] -abstract trait Cov13[+A <: AnyRef, -B <: List[_]] extends Object +abstract trait Cov13[+A <: AnyRef, -B <: List[_]] extends AnyRef extest.Cov13[_ <: AnyRef, _ <: List[_]] -abstract trait Cov14[A <: AnyRef, +B <: List[_]] extends Object +abstract trait Cov14[A <: AnyRef, +B <: List[_]] extends AnyRef extest.Cov14[_ <: AnyRef, _ <: List[_]] -abstract trait Cov15[A <: AnyRef, B <: List[_]] extends Object +abstract trait Cov15[A <: AnyRef, B <: List[_]] extends AnyRef extest.Cov15[_ <: AnyRef, _ <: List[_]] -abstract trait Cov16[A <: AnyRef, -B <: List[_]] extends Object +abstract trait Cov16[A <: AnyRef, -B <: List[_]] extends AnyRef extest.Cov16[_ <: AnyRef, _ <: List[_]] -abstract trait Cov17[-A <: AnyRef, +B <: List[_]] extends Object +abstract trait Cov17[-A <: AnyRef, +B <: List[_]] extends AnyRef extest.Cov17[_ <: AnyRef, _ <: List[_]] -abstract trait Cov18[-A <: AnyRef, B <: List[_]] extends Object +abstract trait Cov18[-A <: AnyRef, B <: List[_]] extends AnyRef extest.Cov18[_ <: AnyRef, _ <: List[_]] -abstract trait Cov19[-A <: AnyRef, -B <: List[_]] extends Object +abstract trait Cov19[-A <: AnyRef, -B <: List[_]] extends AnyRef extest.Cov19[_ <: AnyRef, _ <: List[_]] -abstract trait Cov21[+A, +B] extends Object +abstract trait Cov21[+A, +B] extends AnyRef extest.Cov21[_, _] -abstract trait Cov22[+A, B] extends Object +abstract trait Cov22[+A, B] extends AnyRef extest.Cov22[_, _] -abstract trait Cov23[+A, -B] extends Object +abstract trait Cov23[+A, -B] extends AnyRef extest.Cov23[_, _] -abstract trait Cov24[A, +B] extends Object +abstract trait Cov24[A, +B] extends AnyRef extest.Cov24[_, _] -abstract trait Cov25[A, B] extends Object +abstract trait Cov25[A, B] extends AnyRef extest.Cov25[_, _] -abstract trait Cov26[A, -B] extends Object +abstract trait Cov26[A, -B] extends AnyRef extest.Cov26[_, _] -abstract trait Cov27[-A, +B] extends Object +abstract trait Cov27[-A, +B] extends AnyRef extest.Cov27[_, _] -abstract trait Cov28[-A, B] extends Object +abstract trait Cov28[-A, B] extends AnyRef extest.Cov28[_, _] -abstract trait Cov29[-A, -B] extends Object +abstract trait Cov29[-A, -B] extends AnyRef extest.Cov29[_, _] -abstract trait Cov31[+A, +B, C <: (A, B)] extends Object +abstract trait Cov31[+A, +B, C <: (A, B)] extends AnyRef extest.Cov31[A,B,C] forSome { +A; +B; C <: (A, B) } -abstract trait Cov32[+A, B, C <: (A, B)] extends Object +abstract trait Cov32[+A, B, C <: (A, B)] extends AnyRef extest.Cov32[A,B,C] forSome { +A; B; C <: (A, B) } -abstract trait Cov33[+A, -B, C <: Tuple2[A, _]] extends Object +abstract trait Cov33[+A, -B, C <: Tuple2[A, _]] extends AnyRef extest.Cov33[A,B,C] forSome { +A; -B; C <: Tuple2[A, _] } -abstract trait Cov34[A, +B, C <: (A, B)] extends Object +abstract trait Cov34[A, +B, C <: (A, B)] extends AnyRef extest.Cov34[A,B,C] forSome { A; +B; C <: (A, B) } -abstract trait Cov35[A, B, C <: (A, B)] extends Object +abstract trait Cov35[A, B, C <: (A, B)] extends AnyRef extest.Cov35[A,B,C] forSome { A; B; C <: (A, B) } -abstract trait Cov36[A, -B, C <: Tuple2[A, _]] extends Object +abstract trait Cov36[A, -B, C <: Tuple2[A, _]] extends AnyRef extest.Cov36[A,B,C] forSome { A; -B; C <: Tuple2[A, _] } -abstract trait Cov37[-A, +B, C <: Tuple2[_, B]] extends Object +abstract trait Cov37[-A, +B, C <: Tuple2[_, B]] extends AnyRef extest.Cov37[A,B,C] forSome { -A; +B; C <: Tuple2[_, B] } -abstract trait Cov38[-A, B, C <: Tuple2[_, B]] extends Object +abstract trait Cov38[-A, B, C <: Tuple2[_, B]] extends AnyRef extest.Cov38[A,B,C] forSome { -A; B; C <: Tuple2[_, B] } -abstract trait Cov39[-A, -B, C <: Tuple2[_, _]] extends Object +abstract trait Cov39[-A, -B, C <: Tuple2[_, _]] extends AnyRef extest.Cov39[_, _, _ <: Tuple2[_, _]] -abstract trait Cov41[+A >: Null, +B] extends Object +abstract trait Cov41[+A >: Null, +B] extends AnyRef extest.Cov41[_ >: Null, _] -abstract trait Cov42[+A >: Null, B] extends Object +abstract trait Cov42[+A >: Null, B] extends AnyRef extest.Cov42[_ >: Null, _] -abstract trait Cov43[+A >: Null, -B] extends Object +abstract trait Cov43[+A >: Null, -B] extends AnyRef extest.Cov43[_ >: Null, _] -abstract trait Cov44[A >: Null, +B] extends Object +abstract trait Cov44[A >: Null, +B] extends AnyRef extest.Cov44[_ >: Null, _] -abstract trait Cov45[A >: Null, B] extends Object +abstract trait Cov45[A >: Null, B] extends AnyRef extest.Cov45[_ >: Null, _] -abstract trait Cov46[A >: Null, -B] extends Object +abstract trait Cov46[A >: Null, -B] extends AnyRef extest.Cov46[_ >: Null, _] -abstract trait Cov47[-A >: Null, +B] extends Object +abstract trait Cov47[-A >: Null, +B] extends AnyRef extest.Cov47[_ >: Null, _] -abstract trait Cov48[-A >: Null, B] extends Object +abstract trait Cov48[-A >: Null, B] extends AnyRef extest.Cov48[_ >: Null, _] -abstract trait Cov49[-A >: Null, -B] extends Object +abstract trait Cov49[-A >: Null, -B] extends AnyRef extest.Cov49[_ >: Null, _] -abstract trait Covariant[+A <: AnyRef, +B] extends Object +abstract trait Covariant[+A <: AnyRef, +B] extends AnyRef extest.Covariant[_ <: AnyRef, _] -abstract trait CovariantLike[+A <: AnyRef, +B <: List[A], +This <: extest.CovariantLike[A,B,This] with extest.Covariant[A,B]] extends Object +abstract trait CovariantLike[+A <: AnyRef, +B <: List[A], +This <: extest.CovariantLike[A,B,This] with extest.Covariant[A,B]] extends AnyRef extest.CovariantLike[A,B,This] forSome { +A <: AnyRef; +B <: List[A]; +This <: extest.CovariantLike[A,B,This] with extest.Covariant[A,B] } diff --git a/test/files/run/existentials3-new.check b/test/files/run/existentials3-new.check index 00614b19db..8f7dd701ac 100644 --- a/test/files/run/existentials3-new.check +++ b/test/files/run/existentials3-new.check @@ -7,7 +7,7 @@ Test.ToS, t=RefinedType, s=f5 () => Test.ToS, t=TypeRef, s=trait Function0 $anon, t=TypeRef, s=type $anon $anon, t=TypeRef, s=type $anon -List[java.lang.Object{type T1}#T1], t=TypeRef, s=class List +List[AnyRef{type T1}#T1], t=TypeRef, s=class List List[Seq[Int]], t=TypeRef, s=class List List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List Bar.type, t=TypeRef, s=type Bar.type @@ -19,6 +19,6 @@ Test.ToS, t=RefinedType, s=g5 () => Test.ToS, t=TypeRef, s=trait Function0 $anon, t=TypeRef, s=type $anon $anon, t=TypeRef, s=type $anon -List[java.lang.Object{type T1}#T1], t=TypeRef, s=class List +List[AnyRef{type T1}#T1], t=TypeRef, s=class List List[Seq[Int]], t=TypeRef, s=class List List[Seq[U forSome { type U <: Int }]], t=TypeRef, s=class List diff --git a/test/files/run/macro-declared-in-trait.check b/test/files/run/macro-declared-in-trait.check index 104ff1e99b..0d70ac74f3 100644 --- a/test/files/run/macro-declared-in-trait.check +++ b/test/files/run/macro-declared-in-trait.check @@ -1,5 +1,5 @@ prefix = Expr[Nothing]({ - final class $anon extends Object with Base { + final class $anon extends AnyRef with Base { def <init>(): anonymous class $anon = { $anon.super.<init>(); () diff --git a/test/files/run/reflection-equality.check b/test/files/run/reflection-equality.check index 17c1f6dd70..65b525731f 100644 --- a/test/files/run/reflection-equality.check +++ b/test/files/run/reflection-equality.check @@ -24,7 +24,7 @@ cs: reflect.runtime.universe.ClassSymbol = class X scala> val ts: Type = cs.typeSignature ts: reflect.runtime.universe.Type = -java.lang.Object { +scala.AnyRef { def <init>(): X def methodIntIntInt(x: scala.Int,y: scala.Int): scala.Int } 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( diff --git a/test/files/run/repl-parens.check b/test/files/run/repl-parens.check index 4b7ce6b059..15f4b4524a 100644 --- a/test/files/run/repl-parens.check +++ b/test/files/run/repl-parens.check @@ -66,7 +66,7 @@ scala> 55 ; () => 5 res13: () => Int = <function0> scala> () => { class X ; new X } -res14: () => Object = <function0> +res14: () => AnyRef = <function0> scala> diff --git a/test/files/run/t4172.check b/test/files/run/t4172.check index f16c9e5151..94cdff4870 100644 --- a/test/files/run/t4172.check +++ b/test/files/run/t4172.check @@ -5,7 +5,7 @@ scala> scala> val c = { class C { override def toString = "C" }; ((new C, new C { def f = 2 })) } warning: there were 1 feature warnings; re-run with -feature for details -c: (C, C{def f: Int}) forSome { type C <: Object } = (C,C) +c: (C, C{def f: Int}) forSome { type C <: AnyRef } = (C,C) scala> diff --git a/test/files/run/t5256a.check b/test/files/run/t5256a.check index 7e60139db3..09b5a02831 100644 --- a/test/files/run/t5256a.check +++ b/test/files/run/t5256a.check @@ -1,6 +1,6 @@ class A A -Object { +AnyRef { def <init>(): A def foo: Nothing } diff --git a/test/files/run/t5256b.check b/test/files/run/t5256b.check index a80df6eb30..ca93aaa706 100644 --- a/test/files/run/t5256b.check +++ b/test/files/run/t5256b.check @@ -1,6 +1,6 @@ class A Test.A -Object { +AnyRef { def <init>(): Test.A def foo: Nothing } diff --git a/test/files/run/t5256d.check b/test/files/run/t5256d.check index 9742ae572e..b7617e80a2 100644 --- a/test/files/run/t5256d.check +++ b/test/files/run/t5256d.check @@ -22,7 +22,7 @@ scala> println(c.fullName) $line8.$read.$iw.$iw.$iw.$iw.A scala> println(c.typeSignature) -java.lang.Object { +scala.AnyRef { def <init>(): A def foo: scala.Nothing } diff --git a/test/files/run/t5256e.check b/test/files/run/t5256e.check index 011115720c..ed3513183e 100644 --- a/test/files/run/t5256e.check +++ b/test/files/run/t5256e.check @@ -1,6 +1,6 @@ class A Test.C.A -Object { +AnyRef { def <init>(): C.this.A def foo: Nothing } diff --git a/test/files/run/t5256f.check b/test/files/run/t5256f.check index e0fec85596..6a89d0b86a 100644 --- a/test/files/run/t5256f.check +++ b/test/files/run/t5256f.check @@ -1,12 +1,12 @@ class A1 Test.A1 -Object { +AnyRef { def <init>(): Test.A1 def foo: Nothing } class A2 Test.A2 -Object { +AnyRef { def <init>(): Test.this.A2 def foo: Nothing } |