Skip to content

Commit b2215ed

Browse files
committed
Add a test to check multidimenstionall arrays.
1 parent 0a09332 commit b2215ed

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/run/MultiArr.scala

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class Arr {
2+
val s = new Array[Int](1)
3+
val s2 = new Array[Array[Int]](2)
4+
val s3: Array[Array[Int]] = Array.ofDim(2,3)
5+
/*
6+
public Arr();
7+
Code:
8+
0: aload_0
9+
1: invokespecial #14 // Method java/lang/Object."<init>":()V
10+
4: aload_0
11+
5: iconst_1
12+
6: newarray int
13+
8: checkcast #15 // class "[I"
14+
11: putfield #17 // Field s$$local:[I
15+
14: aload_0
16+
15: iconst_2
17+
16: anewarray #15 // class "[I"
18+
19: checkcast #18 // class "[[I"
19+
22: putfield #20 // Field s2$$local:[[I
20+
25: aload_0
21+
26: getstatic #26 // Field scala/Array$.MODULE$:Lscala/Array$;
22+
29: pop
23+
30: iconst_2
24+
31: iconst_3
25+
32: multianewarray #18, 2 // class "[[I"
26+
36: checkcast #18 // class "[[I"
27+
39: putfield #28 // Field s3$$local:[[I
28+
42: return
29+
*/
30+
}
31+
32+
object Test{
33+
def main(args: Array[String]): Unit = {
34+
new Arr
35+
}
36+
}
37+

0 commit comments

Comments
 (0)