diff --git a/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala b/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala index 2982238490e1..bbc0fa8cd3c1 100644 --- a/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala +++ b/compiler/test/dotty/tools/dotc/transform/SpecializeFunctionsTests.scala @@ -147,6 +147,7 @@ class SpecializeFunctionsTests extends DottyBytecodeTest { } .map(_.name) .toList + .distinct // ignore bridge methods assert( apps.length == 1, diff --git a/tests/run/trait-bridge-signatures.scala b/tests/run/trait-bridge-signatures.scala index 410803df2e22..b9da5ed5f4c2 100644 --- a/tests/run/trait-bridge-signatures.scala +++ b/tests/run/trait-bridge-signatures.scala @@ -129,10 +129,19 @@ object Test { classOf[collections.Iterable[?]], classOf[collections.IterableOps[?, ?, ?]], Class.forName("collections$Seq") - ).foreach(show(_, m => List("head", "tail", "from").contains(m.getName()))) + ).foreach: cls => + show(cls, filter = m => List("head", "tail", "from").contains(m.getName()) && { + // Divirgence between JVM version + // In JDK 8 (CI Windows runner) `java.lang.Object collections$IterableOps.head()` is shown + // but it's not shown in JDK 17 (CI Unix runner) + // Filter out problematic case to make tests more stable + if cls == classOf[collections.LinearSeq[?]] then + List(cls, classOf[collections.LinearSeqOps[?, ?, ?]]).contains(m.getDeclaringClass()) + else true + } + ) show(Class.forName("EmptyCollection"), _.getName() == "andThen") - show(classOf[play.WSRequest]) } }