Basically, I have an array like this:
val base_length = Array(
0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56,
64, 80, 96, 112, 128, 160, 192, 224, 0
);
And when scala sees it, it wants to do this:
base_length: Array[Int] = Array(...)
But I would prefer for it to do this:
base_length: Array[Byte] = Array(...)
I tried:
val base_length = Array[Byte](...)
But scala says:
<console>:4: error: type arguments [Byte] do not conform to method apply's type
parameter bounds [A <: AnyRef]
val base_length = Array[Byte](1,2,3,4,5)
This seems to me to basically be telling me that the Array constructor wants to figure out what the type of the array is from the arguments. Normally that's awesome, but in this instance I have good reasons for wanting the array elements to be Byte
s.
I have looked around for guidance on this, but I don't seem to be able to find anything. Any help would be great!