diff options
author | Paul Phillips <paulp@improving.org> | 2012-11-10 15:52:25 -0700 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-11-19 11:52:47 -0800 |
commit | 120879e2f5a10beaa94ef9e886e67a1c092fded0 (patch) | |
tree | b6b39ed8be9fd5c4caabd42de69979c12d154139 /src/compiler/scala/tools/nsc/typechecker/Macros.scala | |
parent | dbd7d718ae4a18a6b78b8d52fb554e15830eb30c (diff) | |
download | scala-120879e2f5a10beaa94ef9e886e67a1c092fded0.tar.gz scala-120879e2f5a10beaa94ef9e886e67a1c092fded0.tar.bz2 scala-120879e2f5a10beaa94ef9e886e67a1c092fded0.zip |
Deal with possibly spurious warning in Macros.
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/Macros.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Macros.scala | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/Macros.scala b/src/compiler/scala/tools/nsc/typechecker/Macros.scala index 09f3fefeba..4b534b0d2e 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Macros.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Macros.scala @@ -720,16 +720,15 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { /** Does the same as `macroExpand`, but without typechecking the expansion * Meant for internal use within the macro infrastructure, don't use it elsewhere. */ - private def macroExpand1(typer: Typer, expandee: Tree): MacroExpansionResult = + private def macroExpand1(typer: Typer, expandee: Tree): MacroExpansionResult = { // verbose printing might cause recursive macro expansions, so I'm shutting it down here withInfoLevel(nodePrinters.InfoLevel.Quiet) { if (expandee.symbol.isErroneous || (expandee exists (_.isErroneous))) { val reason = if (expandee.symbol.isErroneous) "not found or incompatible macro implementation" else "erroneous arguments" macroTraceVerbose("cancelled macro expansion because of %s: ".format(reason))(expandee) - return Cancel(typer.infer.setError(expandee)) + Cancel(typer.infer.setError(expandee)) } - - try { + else try { val runtime = macroRuntime(expandee.symbol) if (runtime != null) macroExpandWithRuntime(typer, expandee, runtime) else macroExpandWithoutRuntime(typer, expandee) @@ -737,6 +736,7 @@ trait Macros extends scala.tools.reflect.FastTrack with Traces { case typer.TyperErrorGen.MacroExpansionException => Failure(expandee) } } + } /** Expands a macro when a runtime (i.e. the macro implementation) can be successfully loaded * Meant for internal use within the macro infrastructure, don't use it elsewhere. |