Skip to content

Instantly share code, notes, and snippets.

View ivmaykov's full-sized avatar

Ilya Maykov ivmaykov

View GitHub Profile
import org.scalatest.{Matchers, FlatSpec}
case class Foo(bar: Option[String])
object Foo {
// Unexpectedly, Foo.Default.bar is null at runtime. Swapping the order of Default and Unknown, or making
// either of them a lazy val, fixes the issue.
val Default = Foo(Unknown)
val Unknown = None
}