summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2011-12-22 15:33:59 +0100
committerPaul Phillips <paulp@improving.org>2011-12-22 19:32:47 -0800
commit7d3ec837a3883e1e79700ee7c8fe6ab3f7bbd73c (patch)
treede7761d59adc8eb5217ab3013ad211bae80d59e4 /src/compiler
parent91de7d6e65a2bc3096d3af5bd32f70e17627a02a (diff)
downloadscala-7d3ec837a3883e1e79700ee7c8fe6ab3f7bbd73c.tar.gz
scala-7d3ec837a3883e1e79700ee7c8fe6ab3f7bbd73c.tar.bz2
scala-7d3ec837a3883e1e79700ee7c8fe6ab3f7bbd73c.zip
Omit non-essential TypeApply trees.
Otherwise they cause type errors.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/runtime/ToolBoxes.scala5
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala4
-rw-r--r--src/compiler/scala/tools/nsc/transform/LiftCode.scala4
3 files changed, 6 insertions, 7 deletions
diff --git a/src/compiler/scala/reflect/runtime/ToolBoxes.scala b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
index 3bfdf1e6e7..7ef625b2ad 100644
--- a/src/compiler/scala/reflect/runtime/ToolBoxes.scala
+++ b/src/compiler/scala/reflect/runtime/ToolBoxes.scala
@@ -61,9 +61,9 @@ trait ToolBoxes extends { self: Universe =>
def makeParam(fv: Symbol) = meth.newValueParameter(NoPosition, fv.name) setInfo fv.tpe
meth setInfo MethodType(fvs map makeParam, expr.tpe)
minfo.decls enter meth
- println("wrapping "+(defOwner(expr) -> meth))
+ trace("wrapping ")(defOwner(expr) -> meth)
val methdef = DefDef(meth, expr changeOwner (defOwner(expr) -> meth))
- println("wrapped: "+showAttributed(methdef))
+ trace("wrapped: ")(showAttributed(methdef))
val objdef = ModuleDef(
obj,
Template(
@@ -99,7 +99,6 @@ trait ToolBoxes extends { self: Universe =>
jclazz.getDeclaredMethods.find(_.getName == name).get
def runExpr(expr: Tree): Any = {
- settings.Xprint.value = List("typer", "erasure")
val etpe = expr.tpe
val fvs = (expr filter isFree map (_.symbol)).distinct
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index 85849cfad4..9668debbbb 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -257,10 +257,6 @@ trait Trees extends reflect.internal.Trees { self: Global =>
case _: DefTree | Function(_, _) | Template(_, _, _) =>
resetDef(tree)
tree.tpe = null
- tree match {
- case tree: DefDef => tree.tpt.tpe = null
- case _ => ()
- }
case tpt: TypeTree =>
if (tpt.wasEmpty) tree.tpe = null
case This(_) if tree.symbol != null && tree.symbol.isPackageClass =>
diff --git a/src/compiler/scala/tools/nsc/transform/LiftCode.scala b/src/compiler/scala/tools/nsc/transform/LiftCode.scala
index f3f823d197..9404f0f699 100644
--- a/src/compiler/scala/tools/nsc/transform/LiftCode.scala
+++ b/src/compiler/scala/tools/nsc/transform/LiftCode.scala
@@ -476,6 +476,10 @@ abstract class LiftCode extends Transform with TypingTransformers {
if (!(boundSyms exists (tt.tpe contains _))) mirrorCall("TypeTree", reifyType(tt.tpe))
else if (tt.original != null) reify(tt.original)
else mirrorCall("TypeTree")
+ case ta @ TypeApply(hk, ts) =>
+ val thereAreOnlyTTs = ts collect { case t if !t.isInstanceOf[TypeTree] => t } isEmpty;
+ val ttsAreNotEssential = ts collect { case tt: TypeTree => tt } find { tt => tt.original != null } isEmpty;
+ if (thereAreOnlyTTs && ttsAreNotEssential) reifyTree(hk) else reifyProduct(ta)
case global.emptyValDef =>
mirrorSelect("emptyValDef")
case _ =>