Closed ryan-williams closed 8 years ago
Yea, I've also run it in a few contexts without seeing it. I'll dig around a little more to try to understand what's happening.
OK, have it basically figured out:
.array
doesn't exist on most Scala collections; it exists on WrappedArray
.Array
is convertible to WrappedArray
via an always-available implicitWrappedArray
are the type-specific ones in the companion object here.
Array[Allele]
becomes a WrappedArray$ofRef
.WrappedArray$ofRef.array
throws a ClassCastException
when the underlying array is empty.
Array
to a WrappedArray
then back is losing the class-info and falling back to Object
, it seems?In any case, we wouldn't want this .array
even if that bug didn't exist… ArrayOps
implicitly provides .toArray
on Seq
s afaik and is the thing to use when that's the conversion you want, but in this case we already have an Array
without an additional conversion, so the whole line can go away.
As an aside: if it's abnormal or unintended that we'd ever have that alleles
array be empty, that could be worth digging into further; lmk if you think that's the case!
I was seeing task (then stage) failures in
Likelihood
due to the.array
call I removed here:Is there a reason it was needed? Any ideas why it would lead to this crashing?