summaryrefslogtreecommitdiff
path: root/test/files/run/macro-typecheck-macrosdisabled2.check
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-04-19 15:01:46 -0700
committerPaul Phillips <paulp@improving.org>2013-04-20 15:25:53 -0700
commitc29405dfe1a24419ce4ce10500b5e8d05c581bee (patch)
treedca5ea3a915101613b6d007831d9240596b685f5 /test/files/run/macro-typecheck-macrosdisabled2.check
parentd506bedc5ab83bf9af8cc0240e61a0c691f8508b (diff)
downloadscala-c29405dfe1a24419ce4ce10500b5e8d05c581bee.tar.gz
scala-c29405dfe1a24419ce4ce10500b5e8d05c581bee.tar.bz2
scala-c29405dfe1a24419ce4ce10500b5e8d05c581bee.zip
Simplify type bounds.
I started out looking to limit the noise from empty type bounds, i.e. the endless repetition of class A[T >: _root_.scala.Nothing <: _root_.scala.Any] This led me to be reminded of all the unnecessary and in fact damaging overreaches which are performed during parsing. Why should a type parameter for which no bounds are specified be immediately encoded with this giant tree: TypeBounds( Select(Select(Ident(nme.ROOTPKG), tpnme.scala_), tpnme.Nothing), Select(Select(Ident(nme.ROOTPKG), tpnme.scala_), tpnme.Any) ) ...which must then be manually recognized as empty type bounds? Truly, this is madness. - It deftly eliminates the possibility of recognizing whether the user wrote "class A[T]" or "class A[T >: Nothing]" or "class A[T <: Any]" or specified both bounds. The fact that these work out the same internally does not imply the information should be exterminated even before parsing completes. - It burdens everyone who must recognize type bounds trees, such as this author - It is far less efficient than the obvious encoding - It offers literally no advantage whatsoever Encode empty type bounds as TypeBounds(EmptyTree, EmptyTree) What could be simpler.
Diffstat (limited to 'test/files/run/macro-typecheck-macrosdisabled2.check')
-rw-r--r--test/files/run/macro-typecheck-macrosdisabled2.check4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/files/run/macro-typecheck-macrosdisabled2.check b/test/files/run/macro-typecheck-macrosdisabled2.check
index 75fd693722..347dfec1dc 100644
--- a/test/files/run/macro-typecheck-macrosdisabled2.check
+++ b/test/files/run/macro-typecheck-macrosdisabled2.check
@@ -7,7 +7,7 @@
$treecreator1.super.<init>();
()
};
- def apply[U >: Nothing <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = {
+ def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Tree = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.Apply.apply($u.Select.apply($u.build.Ident($m.staticModule("scala.Array")), $u.TermName.apply("apply")), scala.collection.immutable.List.apply[$u.Literal]($u.Literal.apply($u.Constant.apply(2))))
@@ -20,7 +20,7 @@
$typecreator2.super.<init>();
()
};
- def apply[U >: Nothing <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = {
+ def apply[U <: scala.reflect.api.Universe with Singleton]($m$untyped: scala.reflect.api.Mirror[U]): U#Type = {
val $u: U = $m$untyped.universe;
val $m: $u.Mirror = $m$untyped.asInstanceOf[$u.Mirror];
$u.TypeRef.apply($u.ThisType.apply($m.staticPackage("scala").asModule.moduleClass), $m.staticClass("scala.Array"), scala.collection.immutable.List.apply[$u.Type]($m.staticClass("scala.Int").asType.toTypeConstructor))