We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 71aac7f commit f7e0d31Copy full SHA for f7e0d31
tests/run/option-extract.scala
@@ -6,7 +6,7 @@ enum Option[+A]:
6
opaque type ExtractResult[B] = (=> B) => B
7
8
def extract[B](f: A => B): ExtractResult[B] =
9
- def result(default: => B): B = this match
+ def result(default: => B): B = (this: Option[A]) match
10
case None => default
11
case Some(elem) => f(elem)
12
result
0 commit comments