scala> UByteArrayTile.empty(46500, 46500)
^
java.lang.NegativeArraySizeException
at scala.reflect.ManifestFactory$$anon$6.newArray(Manifest.scala:93)
at scala.reflect.ManifestFactory$$anon$6.newArray(Manifest.scala:91)
at scala.Array$.ofDim(Array.scala:218)
at geotrellis.raster.UByteArrayTile$.fill(UByteArrayTile.scala:300)
at geotrellis.raster.UByteArrayTile$.empty(UByteArrayTile.scala:269)
at geotrellis.raster.UByteArrayTile$.empty(UByteArrayTile.scala:254)
... 40 elided
If .empty is just multiplying its arguments before calling .ofDim, then it makes sense than we'd hit an overflow. Can this error case be modelled in the types somehow? If not, can a more descriptive exception be thrown?
If
.empty
is just multiplying its arguments before calling.ofDim
, then it makes sense than we'd hit an overflow. Can this error case be modelled in the types somehow? If not, can a more descriptive exception be thrown?