New issue
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
Add support for checked casts in debug mode #858
Comments
densh
changed the title
Add support for checked casts in debug mode
Jun 27, 2017
0.asInstanceOf[String]
should fail at runtime
Casts are unchecked on purpose in release mode. We wanted to make them checked in debug for a while now, but there was no issue for it. |
matil019
added a commit
to matil019/scala-native
that referenced
this issue
Jun 27, 2017
Array[E].toArray[T](Array[T]) is still not compliant because it is specified to throw ArrayStoreException if not T >: E but it doesn't. This can't be fixed now because there is no compile-time type information and runtime cast is not type-checked. See scala-native#858.
matil019
added a commit
to matil019/scala-native
that referenced
this issue
Jun 27, 2017
Array[E].toArray[T](Array[T]) is not still compliant because it is specified to throw ArrayStoreException if not T >: E but it doesn't. This can't be fixed now because there is no compile-time type information and runtime cast is not type-checked. See scala-native#858.
matil019
added a commit
to matil019/scala-native
that referenced
this issue
Jun 27, 2017
Array[E].toArray[T](Array[T]) is not still compliant because it is specified to throw ArrayStoreException if not T >: E but it doesn't. This can't be fixed now because there is no compile-time type information and runtime cast is not type-checked. See scala-native#858.
densh
pushed a commit
that referenced
this issue
Jun 27, 2017
* Throw more exceptions as specified in the JDK Javadoc Array[E].toArray[T](Array[T]) is not still compliant because it is specified to throw ArrayStoreException if not T >: E but it doesn't. This can't be fixed now because there is no compile-time type information and runtime cast is not type-checked. See #858. * Change the type of ArrayList.inner to Array[Any] Found that Scala(-Native) can handle Array[Any] just fine.
asoltysik
pushed a commit
to asoltysik/scala-native
that referenced
this issue
Jul 14, 2017
…tive#878) * Throw more exceptions as specified in the JDK Javadoc Array[E].toArray[T](Array[T]) is not still compliant because it is specified to throw ArrayStoreException if not T >: E but it doesn't. This can't be fixed now because there is no compile-time type information and runtime cast is not type-checked. See scala-native#858. * Change the type of ArrayList.inner to Array[Any] Found that Scala(-Native) can handle Array[Any] just fine.
Superseded by #1140 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The following code compiles fine, but its behavior is different on the JVM and on Native:
On Native, the first
println
will print0
, but it should throw an exception.The second
println
will print an empty line, but it should throw an exception too.The text was updated successfully, but these errors were encountered: