Skip to content

Commit

Permalink
Avoid NoPosition.start in Scaladoc warning
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Mar 21, 2024
1 parent 5aa3dc5 commit ca7ef66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/scala/tools/nsc/ast/DocComments.scala
Expand Up @@ -363,7 +363,7 @@ trait DocComments { self: Global =>
case Some(replacement) => replaceWith(replacement)
case None =>
val pos = docCommentPos(sym)
val loc = pos withPoint (pos.start + vstart + 1)
val loc = if (pos.isDefined) pos.withPoint(pos.start + vstart + 1) else NoPosition
runReporting.warning(loc, s"Variable $vname undefined in comment for $sym in $site", WarningCategory.Scaladoc, sym)
}
}
Expand Down

0 comments on commit ca7ef66

Please sign in to comment.