Skip to content

Fix #540 - unbounded array test for wildcard array arguments #542

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

Merged

Conversation

odersky
Copy link
Contributor

@odersky odersky commented May 6, 2015

Arrays with wildcard arguments such as Array[_ <: Foo] where Foo is a
universal trait are now diagnosed as unbounded generic arrays and are
erased to Object.

Review by @smarter

Arrays with wildcard arguments such as Array[_ <: Foo] where Foo is a
universal trait are now diagnosed as unbounded generic arrays and are
erased to Object.
@@ -365,6 +366,7 @@ class TypeErasure(isJava: Boolean, semiEraseVCs: Boolean, isConstructor: Boolean
val defn.ArrayType(elemtp) = tp
def arrayErasure(tpToErase: Type) =
erasureFn(isJava, semiEraseVCs = false, isConstructor, wildcardOK)(tpToErase)
println(s"erase array, elemtp = $elemtp")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

println left in code.

@smarter
Copy link
Member

smarter commented May 6, 2015

The documentation of isUnboundedGeneric should be updated to mention "universal trait" instead of "Any". (Also the documentation mentions ObjectArray which appears nowhere else in the source code, might be something that we want to clarify).

DarkDimius added a commit that referenced this pull request May 8, 2015
…-array

Fix #540 - unbounded array test for wildcard array arguments
@DarkDimius DarkDimius merged commit 14e5ae5 into scala:master May 8, 2015
@allanrenucci allanrenucci deleted the fix/#540-unbounded-generic-array branch December 14, 2017 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants