Skip to content

Commit 4d07f58

Browse files
committed
Add a run test
1 parent c1291d3 commit 4d07f58

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
hello
2+
None
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
object Test:
2+
import scala.annotation.experimental
3+
4+
@experimental def main(args: Array[String]): Unit =
5+
val s1: String | Null = "hello"
6+
val s2: String | Null = null
7+
8+
val opts1: Option[String] = Option.fromNullable(s1)
9+
val opts2: Option[String] = Option.fromNullable(s2)
10+
11+
opts1 match
12+
case Some(s) => println(s)
13+
case None => println("None")
14+
15+
opts2 match
16+
case Some(s) => println(s)
17+
case None => println("None")

0 commit comments

Comments
 (0)