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)
