File tree Expand file tree Collapse file tree 1 file changed +33
-13
lines changed Expand file tree Collapse file tree 1 file changed +33
-13
lines changed Original file line number Diff line number Diff line change 1- def test1 =
2- val v : AnyVal | Null = null
3- if v == null then
4- println(" null" )
1+ case class MyVal (i : Boolean ) extends AnyVal
52
6- def test2 =
7- val v : Int | Null = 1
8- if v != null then
9- println(v)
3+ class Test1 :
104
11- case class MyVal (i : Boolean ) extends AnyVal
5+ def test1 =
6+ val v : AnyVal | Null = null
7+ if v == null then
8+ println(" null" )
9+
10+ def test2 =
11+ val v : Int | Null = 1
12+ if v != null then
13+ println(v)
14+
15+ def test3 =
16+ val v : MyVal | Null = MyVal (false )
17+ if v != null then
18+ println(v)
19+
20+ class Test2 :
21+ import scala .language .unsafeNulls
22+
23+ def test1 =
24+ val v : AnyVal | Null = null
25+ if v == null then
26+ println(" null" )
27+
28+ def test2 =
29+ val v : Int | Null = 1
30+ if v != null then
31+ println(v)
1232
13- def test3 =
14- val v : MyVal | Null = MyVal (false )
15- if v != null then
16- println(v)
33+ def test3 =
34+ val v : MyVal | Null = MyVal (false )
35+ if v != null then
36+ println(v)
You can’t perform that action at this time.
0 commit comments