From 5ef042e92ce5b2d37708df1ce3d492ed45b6e662 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Fri, 22 Nov 2024 12:56:13 +0100 Subject: [PATCH 1/2] Delete duplicate inductive-implicits test This is a duplicate of `tests/bench/inductive-implicits.scala`, which is already tested from `dotty.tools.dotc.BootstrappedOnlyCompilationTest`, also without `-Yno-deep-subtypes`. [Cherry-picked 7653e85f676f7a5d965b5ca879000954ad723f2a] --- .../inductive-implicits-bench.scala | 127 ------------------ 1 file changed, 127 deletions(-) delete mode 100644 tests/pos-deep-subtype/inductive-implicits-bench.scala diff --git a/tests/pos-deep-subtype/inductive-implicits-bench.scala b/tests/pos-deep-subtype/inductive-implicits-bench.scala deleted file mode 100644 index aff8bffd8024..000000000000 --- a/tests/pos-deep-subtype/inductive-implicits-bench.scala +++ /dev/null @@ -1,127 +0,0 @@ -// Adapted from https://github.com/scala/compiler-benchmark/blob/master/corpus/induction/latest/inductive-implicits-bench.scala - -// With polymorphic implicit pruning: -// set resolvers in compilation += "pr-scala snapshots" at "https://scala-ci.typesafe.com/artifactory/scala-pr-validation-snapshots/" -// set scalaVersion in compilation := "2.13.0-pre-765b3ed-SNAPSHOT" -// -// Without polymorphic implicit pruning: -// set resolvers in compilation += "scala-integration" at "https://scala-ci.typesafe.com/artifactory/scala-integration/" -// set scalaVersion in compilation := "2.13.0-pre-1c56f0a" -// -// Then: -// cold -psource=induction -jvmArgs -Xss4M -jvmArgs -Xmx2G -// -// Nb. this is *very* slow without the pruning (> 400s). -// With the pruning: 10-20s on reasonable hardware. - -package shapeless { - sealed trait HList extends Product with Serializable - - final case class ::[+H, +T <: HList](head : H, tail : T) extends HList { - def ::[HH](h : HH) : HH :: H :: T = shapeless.::(h, this) - - override def toString = head match { - case _: ::[_, _] => "("+head.toString+") :: "+tail.toString - case _ => head.toString+" :: "+tail.toString - } - } - - sealed trait HNil extends HList { - def ::[H](h : H) = shapeless.::(h, this) - override def toString = "HNil" - } - - case object HNil extends HNil - - //@annotation.inductive - trait Selector[L <: HList, U] { - def apply(l: L): U - } - - object Selector { - def apply[L <: HList, U](implicit selector: Selector[L, U]): Selector[L, U] = selector - - implicit def inHead[H, T <: HList]: Selector[H :: T, H] = - new Selector[H :: T, H] { - def apply(l : H :: T) = l.head - } - - implicit def inTail[H, T <: HList, U] - (implicit st : Selector[T, U]): Selector[H :: T, U] = - new Selector[H :: T, U] { - def apply(l : H :: T) = st(l.tail) - } - } -} - -import shapeless.* - -object Test extends App { - val sel = Selector[L, Boolean] - - type L = - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - /* - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: Int :: - // - */ - Boolean :: - HNil -} From 044765ec09248c8cad9292094321e81739e8b7d3 Mon Sep 17 00:00:00 2001 From: Matt Bovel Date: Fri, 22 Nov 2024 12:38:05 +0100 Subject: [PATCH 2/2] Comment out 35 more lines in inductive-implicits To avoid reaching the stack limit. [Cherry-picked d3b9d767a4f74457482e7d2c5ec9a9ef8d55b230] --- tests/bench/inductive-implicits.scala | 76 +++++++++++++-------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/tests/bench/inductive-implicits.scala b/tests/bench/inductive-implicits.scala index 58714214ce33..09f147caef3e 100644 --- a/tests/bench/inductive-implicits.scala +++ b/tests/bench/inductive-implicits.scala @@ -174,49 +174,49 @@ object Test extends App { Int :: Int :: // - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: -// - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: -// - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: - Int :: -// - Int :: - Int :: - Int :: - Int :: - Int :: // Int :: // Int :: // Int :: // Int :: // Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// // +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// // +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// // +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: +// Int :: // // // Int :: // Int ::