Scala compiler stack overflow