We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See the discussion of #5353 for motivation.
The text was updated successfully, but these errors were encountered:
Imported From: https://issues.scala-lang.org/browse/SI-7453?orig=1 Reporter: @xeno-by
Sorry, something went wrong.
@retronym said: From #8487
scala> if (false) Array("") else Array.empty java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
@Atry said:
scala> Array.empty[Nothing]: Array[_ <: String] java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
@Atry said: Would it possible to erase {{Array[_ <: String]}} to {{Any}} instead of {{Array[String]}}?
This problem also manifests itself in interop with Java vararg methods:
scala> java.nio.file.Paths.get("/", Nil: _*) java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to [Ljava.lang.String;
However, I guess here the offending array is inserted by the compiler after the typer phase. Should (xs: Seq[Nothing]): _* also be disallowed?
(xs: Seq[Nothing]): _*
No branches or pull requests
See the discussion of #5353 for motivation.
The text was updated successfully, but these errors were encountered: