Skip to content

Commit c327c4c

Browse files
committed
Make TreeTransform type check in dotty. There's no magic type behind getClass in dotty.
1 parent a9867e0 commit c327c4c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/dotty/tools/dotc/transform/TreeTransform.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ object TreeTransforms {
218218
* i <= j
219219
* j == transforms.length || transform(j) defines a non-default method with given `name`
220220
*/
221-
private def index(transformations: Array[Class[_ <: TreeTransform]], name: String): Array[Int] = {
221+
private def index(transformations: Array[Class[_]], name: String): Array[Int] = {
222222
val len = transformations.length
223223
val next = new Array[Int](len + 1)
224224
var nextTransform: Int = len
@@ -240,7 +240,7 @@ object TreeTransforms {
240240
next
241241
}
242242

243-
private def indexUpdate(prev: Array[Int], changedTansformation: Class[_ <: TreeTransform], index: Int, name: String, copy: Boolean = true) = {
243+
private def indexUpdate(prev: Array[Int], changedTansformation: Class[_], index: Int, name: String, copy: Boolean = true) = {
244244
val isDefinedNow = hasRedefinedMethod(changedTansformation, name)
245245
val wasDefinedBefore = prev(index) == index
246246
if (isDefinedNow == wasDefinedBefore) prev
@@ -259,7 +259,7 @@ object TreeTransforms {
259259
}
260260
}
261261

262-
def this(transformations: Array[Class[_ <: TreeTransform]]) = {
262+
def this(transformations: Array[Class[_]]) = {
263263
this()
264264
nxPrepIdent = index(transformations, "prepareForIdent")
265265
nxPrepSelect = index(transformations, "prepareForSelect")
@@ -330,7 +330,7 @@ object TreeTransforms {
330330
}
331331

332332
def this(transformations: Array[TreeTransform]) = {
333-
this(transformations.map(_.getClass))
333+
this(transformations.map(_.getClass).asInstanceOf[Array[Class[_]]])
334334
}
335335

336336
def this(prev: NXTransformations, changedTansformation: TreeTransform, transformationIndex: Int, reuse: Boolean = false) = {

0 commit comments

Comments
 (0)