Skip to content

Array.ofDim(>1) does not produce multianewarray instructions #1259

Closed
@felixmulder

Description

@felixmulder

The code:

object Test {
  def main(args: Array[String]) = {
     val arr = Array.ofDim[Int](2)
  }
}

Should produce something containing:

Code:
   0: iconst_5
   1: bipush        10
   3: multianewarray #2,  2             // class "[[I"
   7: astore_1
   8: return

But produces the following:

Code:
   0: getstatic     #23                 // Field scala/Array$.MODULE$:Lscala/Array$;
   3: pop
   4: iconst_2
   5: newarray       int
   7: checkcast     #25                 // class "[I"
 10: areturn

As such, #1188 does not seem to be working properly. I'd like to have a look at this tomorrow, ping @sjrd

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions