Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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.
  • Loading branch information...
commit 12a18ee0702c4de1eafaf91d4631b25dd883f20c 1 parent fecc7e0
@som-snytt som-snytt authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/compiler/scala/tools/nsc/ast/DocComments.scala
View
5 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")
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.