diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-04-17 21:51:09 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-04-17 21:51:09 -0700 |
commit | 12a18ee0702c4de1eafaf91d4631b25dd883f20c (patch) | |
tree | 77e5d7a9cc2701705679c31276b25e95e36a9189 /src | |
parent | fecc7e04b77859b4cbc61c517453446619549e66 (diff) | |
download | scala-12a18ee0702c4de1eafaf91d4631b25dd883f20c.tar.gz scala-12a18ee0702c4de1eafaf91d4631b25dd883f20c.tar.bz2 scala-12a18ee0702c4de1eafaf91d4631b25dd883f20c.zip |
SI-7376 Bad doc variable error is positioned at the variable.
For a bad $variable, the caret is positioned at the variable
in the doc instead of at the symbol being documented.
Diffstat (limited to 'src')
-rwxr-xr-x | src/compiler/scala/tools/nsc/ast/DocComments.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/DocComments.scala b/src/compiler/scala/tools/nsc/ast/DocComments.scala index 5ad494177c..f2e5c9b1eb 100755 --- a/src/compiler/scala/tools/nsc/ast/DocComments.scala +++ b/src/compiler/scala/tools/nsc/ast/DocComments.scala @@ -366,7 +366,10 @@ trait DocComments { self: Global => case vname => lookupVariable(vname, site) match { case Some(replacement) => replaceWith(replacement) - case None => reporter.warning(sym.pos, "Variable " + vname + " undefined in comment for " + sym + " in " + site) + case None => + val pos = docCommentPos(sym) + val loc = pos withPoint (pos.start + vstart + 1) + reporter.warning(loc, s"Variable $vname undefined in comment for $sym in $site") } } } |