summaryrefslogtreecommitdiff
path: root/test/files/run/t6028.check
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-10-30 08:42:53 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-11-08 11:39:11 +0100
commitdb4ef5b78be2fb7f954d82a972ab70df28acccfa (patch)
treebc5abbabba1d6d7be89ed5ea2e3e05589e80c340 /test/files/run/t6028.check
parent12fe8ef2aff8760a9f0277a7baf74a011753f788 (diff)
downloadscala-db4ef5b78be2fb7f954d82a972ab70df28acccfa.tar.gz
scala-db4ef5b78be2fb7f954d82a972ab70df28acccfa.tar.bz2
scala-db4ef5b78be2fb7f954d82a972ab70df28acccfa.zip
Avoid needless TypeRef allocation during erasure.
- ThisType(some.package) need not be erased, we can let that prefix through unchanged and avoid churning through allocations. - Sharpen the condition in `rebindInnerClass`. The answer to the deleted comment in the code, is "anonymous and local classes", which are specifically excluded in the new formulation. - Finally, detect if erasure of the TypeRef is an identity and reuse the original. Waste not, want not. To expand on the first point, here is what used to happen during erasure: scala> val scalaPack = typeOf[Predef.type].prefix scalaPack: $r.intp.global.Type = scala.type scala> typeDeconstruct.show(scalaPack) res19: String = ThisType(package scala) scala> typeDeconstruct.show(erasure.scalaErasure(scalaPack)) res20: String = TypeRef(TypeSymbol(final class scala extends )) Showing one step of the erasure type map: scala> typeDeconstruct.show(scalaPack.asInstanceOf[SubType].underlying.typeOfThis) res21: String = SingleType(pre = ThisType(package <root>), package scala)
Diffstat (limited to 'test/files/run/t6028.check')
-rw-r--r--test/files/run/t6028.check4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/t6028.check b/test/files/run/t6028.check
index b37bf51d73..a6c4db8f11 100644
--- a/test/files/run/t6028.check
+++ b/test/files/run/t6028.check
@@ -24,7 +24,7 @@ package <empty> {
(new <$anon: Function0>(T.this, tryyParam, tryyLocal): Function0)
}
};
- @SerialVersionUID(0) final <synthetic> class $anonfun$foo$1 extends runtime.AbstractFunction0$mcI$sp with Serializable {
+ @SerialVersionUID(0) final <synthetic> class $anonfun$foo$1 extends scala.runtime.AbstractFunction0$mcI$sp with Serializable {
def <init>($outer: T, methodParam$1: Int, methodLocal$1: Int): <$anon: Function0> = {
$anonfun$foo$1.super.<init>();
()
@@ -60,7 +60,7 @@ package <empty> {
};
scala.this.Predef.print(scala.Int.box(barParam$1))
};
- @SerialVersionUID(0) final <synthetic> class $anonfun$tryy$1 extends runtime.AbstractFunction0$mcV$sp with Serializable {
+ @SerialVersionUID(0) final <synthetic> class $anonfun$tryy$1 extends scala.runtime.AbstractFunction0$mcV$sp with Serializable {
def <init>($outer: T, tryyParam$1: Int, tryyLocal$1: runtime.IntRef): <$anon: Function0> = {
$anonfun$tryy$1.super.<init>();
()