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 56ac3a6 commit b96d7e3Copy full SHA for b96d7e3
tests/explicit-nulls/warn/unnecessary-nn.scala
@@ -10,4 +10,9 @@ def f5a[T <: String](s: T): String = s.nn // warn
10
11
// flexible types
12
def f7(s: String|Null) = "".concat(s.nn) // warn
13
-def f8(s: String): String = s.trim().nn // OK because the .nn could be useful as a dynamic null check
+def f8(s: String): String = s.trim().nn // OK because the .nn could be useful as a dynamic null check
14
+
15
16
+def f9(s: String|Null): String =
17
+ if(s == null) "default"
18
+ else s.nn // warn
0 commit comments