You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>valx=if (false) Array("qwe") elseArray()
x:Array[String] |Array[Nothing] = [Ljava.lang.Object;@5454d35e
scala>valy:Array[_ <:String] = x
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
We either need to disallow Array[Nothing], Array[Null], etc or we need to erase Array[_ <: X] to Object instead of [X;.
It would also be much nicer if we could infer the empty array above to have type Array[String] instead of Array[Nothing], I don't know what prevents us from doing this currently.