We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3bfa2e commit 7291e54Copy full SHA for 7291e54
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