diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-07-30 11:37:59 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-08-10 16:40:13 +0200 |
commit | 5626c7403e44380c6e3610cae8f68f3d2b52eb70 (patch) | |
tree | 582a15327326ccbfab534cf26c2598687e2eabad /src | |
parent | ed5c1abbfca18a880c79048cc7e9578ae932101d (diff) | |
download | scala-5626c7403e44380c6e3610cae8f68f3d2b52eb70.tar.gz scala-5626c7403e44380c6e3610cae8f68f3d2b52eb70.tar.bz2 scala-5626c7403e44380c6e3610cae8f68f3d2b52eb70.zip |
[nomaster] macro errors now always have positions
Back then when I implemented macros for inclusion in trunk (Spring 2012),
partest didn't support the _1, _2, ... convention for neg tests, so I had
to use toolboxes to test macro-generated exceptions.
Unfortunately toolboxes aren't very good with positions (mostly because
their inputs are almost always constructed without corresponding sources)
so I didn't notice that errors signalizing about macro-generated
exceptions actually don't carry positions with them because of a typo.
This patch fixes the oversight, but it doesn't need to be ported to master,
because over there everything's already fixed by one of the backports
from macro paradise.
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala index b9cff5b2d3..5d6d094b44 100644 --- a/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala +++ b/src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala @@ -697,7 +697,7 @@ trait ContextErrors { def msgForLog = if (msg != null && (msg contains "exception during macro expansion")) msg.split(EOL).drop(1).headOption.getOrElse("?") else msg macroLogLite("macro expansion has failed: %s".format(msgForLog)) val errorPos = if (pos != NoPosition) pos else (if (expandee.pos != NoPosition) expandee.pos else enclosingMacroPosition) - if (msg != null) context.error(pos, msg) // issueTypeError(PosAndMsgTypeError(..)) won't work => swallows positions + if (msg != null) context.error(errorPos, msg) // issueTypeError(PosAndMsgTypeError(..)) won't work => swallows positions setError(expandee) throw MacroExpansionException } |