diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2014-03-07 23:00:06 +0100 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2014-03-08 09:22:27 +0100 |
commit | 384322b1cb824b0ff8a2a15a75d33d6a7cf8e85c (patch) | |
tree | 78945768dcdd5341a4313a8e87c608c22dfcc5cc /src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | |
parent | b10f45a78217b002f8ac6e2051ff932a1ac2e029 (diff) | |
download | scala-384322b1cb824b0ff8a2a15a75d33d6a7cf8e85c.tar.gz scala-384322b1cb824b0ff8a2a15a75d33d6a7cf8e85c.tar.bz2 scala-384322b1cb824b0ff8a2a15a75d33d6a7cf8e85c.zip |
Addresses pull request feedback
Diffstat (limited to 'src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index 156f9d4f4a..d439bb5603 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -725,12 +725,18 @@ trait ContextErrors { NormalTypeError(expandee, "too many argument lists for " + fun) } - def MacroIncompatibleEngineError(diagnostic: String) = { - var message = s"macro cannot be expanded, because it was compiled by an incompatible macro engine" - if (macroDebugLite || macroDebugVerbose) message += s" (internal diagnostic: $diagnostic)" + private def MacroIncompatibleEngineError(friendlyMessage: String, internalMessage: String) = { + def debugDiagnostic = s"(internal diagnostic: $internalMessage)" + val message = if (macroDebugLite || macroDebugVerbose) s"$friendlyMessage $debugDiagnostic" else friendlyMessage issueNormalTypeError(lastTreeToTyper, message) } + def MacroCantExpand210xMacrosError(internalMessage: String) = + MacroIncompatibleEngineError("can't expand macros compiled by previous versions of Scala", internalMessage) + + def MacroCantExpandIncompatibleMacrosError(internalMessage: String) = + MacroIncompatibleEngineError("macro cannot be expanded, because it was compiled by an incompatible macro engine", internalMessage) + case object MacroExpansionException extends Exception with scala.util.control.ControlThrowable protected def macroExpansionError(expandee: Tree, msg: String, pos: Position = NoPosition) = { |