IntelliJ grays out code with `throw` in lazy vals - is this a bug?

Viewed 28

IntelliJ grays out this code. I think because it sees the throw and thinks the code is unreachable. However, it is reachable, because the throw is inside a lazy val:

lazy val handleMissing = {
  throw new IllegalStateException(s"Unbound type var $name")
}
map.getOrElse(name, handleMissing)

Same as code sample above

Scastie

1 Answers
Related