scala> def level(tp: Type): Int = erasure.asInstanceOf[{def unboundedGenericArrayLevel(tp: Type): Int}].unboundedGenericArrayLevel(tp)
level: (tp: $r.global.Type)Int
scala> level(typeOf[Array[Int]])
res4: Int = 0
scala> level(typeOf[Array[_]])
res5: Int = 1
scala> level(typeOf[Array[Array[_]]])
res6: Int = 2
scala> level(typeOf[Array[_] with String]) // correct since https://github.com/scala/scala/pull/2592 .
res7: Int = 1
scala> level(typeOf[Array[Array[_] with String]]) // still incorrect
res8: Int = 0
I believe the special case added in that PR should be pushed in the GenericArray extractor so that it works at each level of the test, rather than just for the element type of the outermost Array type.
==================================
[EDITED]: The old description of the bug isn't too useful without the patch. I'm narrowing the focus of this ticket to the issue that I raised in code review.
WAS:
There are a ton of bugs; I have a giant patch, from which I have been cutting off slivers; this ticket exists to make sure that after that patch is in, the issues which have been raised along the way have been adequately addressed.
I believe the special case added in that PR should be pushed in the GenericArray extractor so that it works at each level of the test, rather than just for the element type of the outermost Array type.
================================== [EDITED]: The old description of the bug isn't too useful without the patch. I'm narrowing the focus of this ticket to the issue that I raised in code review. WAS: There are a ton of bugs; I have a giant patch, from which I have been cutting off slivers; this ticket exists to make sure that after that patch is in, the issues which have been raised along the way have been adequately addressed.
For starters, retronym's comments in https://github.com/scala/scala/pull/2592 .
==================================