You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala> class C { def f: Option[Int] = Some(42) }
class C
scala> class D extends C { override def f = None }
class D
scala> class E extends D { override def f = Some(27) }
class E
scala>
:quit
➜ ~ scala
Welcome to Scala 2.13.10 (OpenJDK 64-Bit Server VM, Java 19).
Type in expressions for evaluation. Or try :help.
scala> class C { def f: Option[Int] = Some(42) }
class C
scala> class D extends C { override def f = None }
class D
scala> class E extends D { override def f = Some(27) }
^
error: type mismatch;
found : Some[Int]
required: None.type
I'd be OK if either the types were renamed or maybe just inscribed in a honorary plaque at the top of the stairs at EPFL:
class Som[A](a: A) extends Option[A]
or
type Sombyl = Symbol // a little too close to Sybil of the 16 personalities, not Disraeli's two nations
// https://en.wikipedia.org/wiki/Sybil_(Schreiber_book)
implicit
definitionThe text was updated successfully, but these errors were encountered: