Skip to content

Commit b8b3fa1

Browse files
committed
fix: make the order deterministic in i23882
1 parent e3b4bed commit b8b3fa1

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

tests/run/i23882.check

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
public void Foo.foo(java.lang.Object)
2-
public void Foo.foo(scala.Equals)
3-
public void Foo.bar(Bar)
4-
public void Foo.bar2(Bar)
5-
public void Foo.bar3(Bar)
6-
public void Foo.bar4(Bar)
1+
foo(scala.Equals): void
2+
foo(java.lang.Object): void
3+
bar(Bar): void
4+
bar2(Bar): void
5+
bar3(Bar): void
6+
bar4(Bar): void

tests/run/i23882.scala

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ class Foo:
1313
def bar3[T <: Pure](x: Bar & T): Unit = ??? // erases to Bar
1414
def bar4[T <: Pure](x: T & Bar): Unit = ??? // erases to Bar
1515

16+
def printGenericSignature(m: java.lang.reflect.Method): Unit =
17+
val tpe = m.getParameterTypes().map(_.getTypeName).mkString(", ")
18+
val ret = m.getReturnType().getTypeName
19+
println(s"${m.getName}($tpe): $ret")
20+
1621
@main def Test =
17-
for mtd <- classOf[Foo].getDeclaredMethods do
18-
println(mtd)
22+
val cls = classOf[Foo]
23+
printGenericSignature(cls.getDeclaredMethod("foo", classOf[scala.Equals]))
24+
printGenericSignature(cls.getDeclaredMethod("foo", classOf[Object]))
25+
printGenericSignature(cls.getDeclaredMethod("bar", classOf[Bar]))
26+
printGenericSignature(cls.getDeclaredMethod("bar2", classOf[Bar]))
27+
printGenericSignature(cls.getDeclaredMethod("bar3", classOf[Bar]))
28+
printGenericSignature(cls.getDeclaredMethod("bar4", classOf[Bar]))

0 commit comments

Comments
 (0)