Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>For background information, see this related question: <a href="https://stackoverflow.com/questions/3213510/what-is-a-manifest-in-scala-and-when-do-you-need-it">What is a Manifest in Scala and when do you need it?</a>. In this answer, you will find an explanation why manifests are needed for arrays.</p> <p>In short: Although the JVM uses type erasure, arrays are an exception and need a manifest. Since you could compile your code, that manifest was found (manifests are always available for proper types). Your error occurs at runtime.</p> <p>I don't know the details of the battlecode server, but there are two possibilities: Either you are running your compiled classes with a binary <strong>incompatible version</strong> of Scala (difference in major version, e.g. compiled with Scala 2.9 and server uses 2.10). Or the server doesn't even have the <strong>scala-library.jar</strong> on its class path.</p> <p>As said in the comment, manifests are deprecated in Scala 2.10 and replaced by <code>ClassTag</code>.</p> <hr> <p><strong>EDIT</strong>: So it seems the class loader is artificially restricting the allowed classes. My suggestion would be: Add a helper Java class. You can easily mix Java and Scala code. If it's just about the <code>Int</code>-<code>Array</code> instantiation, you could provide something like:</p> <pre><code>public static class Helper { public static int[][] makeArray(int d1, int d2) { return new int[d1][d2](); } } </code></pre> <p>(hope that's valid java code, a bit rusty)</p> <p>Also, have you tried to create the outer array with <code>new Array[Array[Int]](d1)</code>, and then iterate to create the inner arrays?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload