Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions tests/run/i23882.check
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
public void Foo.foo(java.lang.Object)
public void Foo.foo(scala.Equals)
public void Foo.bar(Bar)
public void Foo.bar2(Bar)
public void Foo.bar3(Bar)
public void Foo.bar4(Bar)
foo(scala.Equals): void
foo(java.lang.Object): void
bar(Bar): void
bar2(Bar): void
bar3(Bar): void
bar4(Bar): void
14 changes: 12 additions & 2 deletions tests/run/i23882.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ class Foo:
def bar3[T <: Pure](x: Bar & T): Unit = ??? // erases to Bar
def bar4[T <: Pure](x: T & Bar): Unit = ??? // erases to Bar

def printGenericSignature(m: java.lang.reflect.Method): Unit =
val tpe = m.getParameterTypes().map(_.getTypeName).mkString(", ")
val ret = m.getReturnType().getTypeName
println(s"${m.getName}($tpe): $ret")

@main def Test =
for mtd <- classOf[Foo].getDeclaredMethods do
println(mtd)
val cls = classOf[Foo]
printGenericSignature(cls.getDeclaredMethod("foo", classOf[scala.Equals]))
printGenericSignature(cls.getDeclaredMethod("foo", classOf[Object]))
printGenericSignature(cls.getDeclaredMethod("bar", classOf[Bar]))
printGenericSignature(cls.getDeclaredMethod("bar2", classOf[Bar]))
printGenericSignature(cls.getDeclaredMethod("bar3", classOf[Bar]))
printGenericSignature(cls.getDeclaredMethod("bar4", classOf[Bar]))
Loading