-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Signature of method taking generic array differs from Scala 2 #8349
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
Labels
Comments
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 22, 2020
When T[] is erased to Object, it should get a Java generic signature of Object and not of T<>. Fixed by reusing the same logic we have in TypeErasure which replaces a bunch of weird code imported from scalac. The new behavior differs in one case from scalac: `Array[_ <: Byte]` gets a generic signature of `byte[]` instead of `Object`, but this is consistent with how we handle erasure (which I think is OK because as far as I can tell, we can't construct a value of type `Array[Nothing]` with Dotty).
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Feb 22, 2020
When T[] is erased to Object, it should get a Java generic signature of Object and not of T<>. Fixed by reusing the same logic we have in TypeErasure which replaces a bunch of weird code imported from scalac. The new behavior differs in one case from scalac: `Array[_ <: Byte]` gets a generic signature of `byte[]` instead of `Object`, but this is consistent with how we handle erasure (which I think is OK because as far as I can tell, we can't construct a value of type `Array[Nothing]` with Dotty).
smarter
added a commit
to dotty-staging/dotty
that referenced
this issue
Mar 3, 2020
When T[] is erased to Object, it should get a Java generic signature of Object and not of T<>. Fixed by reusing the same logic we have in TypeErasure which replaces a bunch of weird code imported from scalac. The new behavior differs in one case from scalac: `Array[_ <: Byte]` gets a generic signature of `byte[]` instead of `Object`, but this is consistent with how we handle erasure (which I think is OK because as far as I can tell, we can't construct a value of type `Array[Nothing]` with Dotty).
smarter
added a commit
that referenced
this issue
Mar 3, 2020
Fix #8349: Generic signatures of generic arrays
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
minimized code
Compilation output
expectation
The text was updated successfully, but these errors were encountered: