Skip to content

Commit

Permalink
Merge pull request #10721 from som-snytt/issue/12964-doc-asInstanceOf
Browse files Browse the repository at this point in the history
Avoid NoPosition.start in Scaladoc warning
  • Loading branch information
som-snytt committed Apr 6, 2024
2 parents 9681c8c + ca7ef66 commit 1120346
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 1120346

Please sign in to comment.