From 3ca9038d08dd4a528ae15ee93d44fc7f1392de4e Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 17 Feb 2014 12:08:28 +0100 Subject: Revert "SI-5920 enables default and named args in macros" This reverts commit a02e053a5dec134f7c7dc53a2c1091039218237d. That commit lead to an error compiling Specs2: [info] [warn] /localhome/jenkinsdbuild/workspace/Community-2.11.x-retronym/dbuild-0.7.1-M1/target-0.7.1-M1/project-builds/specs2-aaa8091b47a34817ca90134ace8b09a9e0f854e9/core/src/test/scala/org/specs2/text/EditDistanceSpec.scala:6: Unused import [info] [warn] import DiffShortener._ [info] [warn] ^ [info] [error] /localhome/jenkinsdbuild/workspace/Community-2.11.x-retronym/dbuild-0.7.1-M1/target-0.7.1-M1/project-builds/specs2-aaa8091b47a34817ca90134ace8b09a9e0f854e9/core/src/test/scala/org/specs2/text/LinesContentDifferenceSpec.scala:7: exception during macro expansion: [info] [error] java.lang.UnsupportedOperationException: Position.point on NoPosition [info] [error] at scala.reflect.internal.util.Position.fail(Position.scala:53) [info] [error] at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:131) [info] [error] at scala.reflect.internal.util.UndefinedPosition.point(Position.scala:126) [info] [error] at org.specs2.reflect.Macros$.sourceOf(Macros.scala:25) [info] [error] at org.specs2.reflect.Macros$.stringExpr(Macros.scala:19) --- src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala') diff --git a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala index 1a6d2f0011..57f27a05fd 100644 --- a/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala +++ b/src/compiler/scala/tools/nsc/typechecker/StdAttachments.scala @@ -85,7 +85,6 @@ trait StdAttachments { tree match { // see the comment to `isMacroExpansionSuppressed` to learn why we need // a special traversal strategy here - case Block(_, expr) => unsuppressMacroExpansion(expr) case Apply(fn, _) => unsuppressMacroExpansion(fn) case TypeApply(fn, _) => unsuppressMacroExpansion(fn) case _ => // do nothing @@ -102,8 +101,6 @@ trait StdAttachments { // we have to account for the fact that during typechecking an expandee might become wrapped, // i.e. surrounded by an inferred implicit argument application or by an inferred type argument application. // in that case the expandee itself will no longer be suppressed and we need to look at the core - // upd. we also need to allow for blocks, because that's what names and defaults are often desugared to - case Block(_, expr) => isMacroExpansionSuppressed(expr) case Apply(fn, _) => isMacroExpansionSuppressed(fn) case TypeApply(fn, _) => isMacroExpansionSuppressed(fn) case _ => false -- cgit v1.2.3