diff --git a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala index de558d2494b3..e71460b806e3 100644 --- a/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala +++ b/compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala @@ -317,7 +317,7 @@ object GenericSignatures { val psyms = parents map (_.typeSymbol) if (psyms contains defn.ArrayClass) { // treat arrays specially - defn.ArrayType.appliedTo(intersectionDominator(parents.filter(_.typeSymbol == defn.ArrayClass).map(t => t.typeParams.head.paramInfo))) + defn.ArrayType.appliedTo(intersectionDominator(parents.filter(_.typeSymbol == defn.ArrayClass).map(t => t.argInfos.head))) } else { // implement new spec for erasure of refined types. def isUnshadowed(psym: Symbol) = diff --git a/tests/generic-java-signatures/i4248.check b/tests/generic-java-signatures/i4248.check new file mode 100644 index 000000000000..fbf53ce0227b --- /dev/null +++ b/tests/generic-java-signatures/i4248.check @@ -0,0 +1 @@ +public void Foo$.foo(int[]) \ No newline at end of file diff --git a/tests/generic-java-signatures/i4248.scala b/tests/generic-java-signatures/i4248.scala new file mode 100644 index 000000000000..91b34cd41a52 --- /dev/null +++ b/tests/generic-java-signatures/i4248.scala @@ -0,0 +1,10 @@ +object Foo { + def foo[U](u: Array[Int] & Array[U]): Unit = () +} + +object Test { + def main(args: Array[String]): Unit = { + val f1 = Foo.getClass.getMethods.find(_.getName.endsWith("foo")).get + println(f1.toGenericString) + } +}