File tree Expand file tree Collapse file tree 2 files changed +31
-30
lines changed
tests/flexible-types/run/array Expand file tree Collapse file tree 2 files changed +31
-30
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ /*
2
+ class Foo {
3
+ def err(msg: String): Nothing = {
4
+ throw new RuntimeException("Hello")
5
+ }
6
+ def retTypeNothing(): String = {
7
+ val y: String|Null = ???
8
+ if (y == null) err("y is null!")
9
+ y
10
+ }
11
+ }
12
+ */
13
+
14
+
15
+ object Test {
16
+ def main () = {
17
+ val i : Integer = new Integer (3 ) // Constructor with non-ref arg
18
+ val s1 : String | Null = new String (" abc" ) // Constructor with ref arg
19
+ val s2 : String = new String (" abc" ) // Constructor with ref arg, not null
20
+ val s3 = s1.nn.substring(0 ,1 ).substring(0 ,1 )
21
+ val s4 = s2.substring(0 ,1 ).substring(0 ,1 )
22
+ val s5 = s4.startsWith(s4)
23
+ // s1.substring(0,1) // error
24
+ val j : J = new J (" " )
25
+ println(s4)
26
+ // val f : Foo = new Foo("x")
27
+ // f.err("Hello")
28
+ // val l : List[String] = Java.returnsNull();
29
+ // val j : J = new J
30
+ }
31
+ }
You can’t perform that action at this time.
0 commit comments