Skip to content

Commit 2fcb7b0

Browse files
authored
Merge pull request #4249 from dotty-staging/fix/4248
Fix #4248: intersection dominator of Arrays
2 parents 4c8a2bd + 488c29d commit 2fcb7b0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

compiler/src/dotty/tools/dotc/transform/GenericSignatures.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ object GenericSignatures {
317317
val psyms = parents map (_.typeSymbol)
318318
if (psyms contains defn.ArrayClass) {
319319
// treat arrays specially
320-
defn.ArrayType.appliedTo(intersectionDominator(parents.filter(_.typeSymbol == defn.ArrayClass).map(t => t.typeParams.head.paramInfo)))
320+
defn.ArrayType.appliedTo(intersectionDominator(parents.filter(_.typeSymbol == defn.ArrayClass).map(t => t.argInfos.head)))
321321
} else {
322322
// implement new spec for erasure of refined types.
323323
def isUnshadowed(psym: Symbol) =
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
public <U> void Foo$.foo(int[])
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
object Foo {
2+
def foo[U](u: Array[Int] & Array[U]): Unit = ()
3+
}
4+
5+
object Test {
6+
def main(args: Array[String]): Unit = {
7+
val f1 = Foo.getClass.getMethods.find(_.getName.endsWith("foo")).get
8+
println(f1.toGenericString)
9+
}
10+
}

0 commit comments

Comments
 (0)