We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e16446 commit 8b45be4Copy full SHA for 8b45be4
tests/explicit-nulls/pos/from-nullable.scala
@@ -0,0 +1,6 @@
1
+import scala.annotation.experimental
2
+
3
+@experimental def testFromNullable =
4
+ val s: String | Null = "abc"
5
+ val sopt1: Option[String] = Option(s) // error
6
+ val sopt2: Option[String] = Option.fromNullable(s) // ok
0 commit comments