Skip to content

Commit 1bd2f9e

Browse files
Comment out tests that dependent on Apply/Unapply
The Unapply match type only worked because of an unsound behavior in match type reduction. To move forward with HK type class derivation we need to find an alternative to the Apply/Unapply trick, either using implicits/macros or by adding a new primitive match type to the compiler. See discussion in scala/scala3#7389.
1 parent 98a211b commit 1bd2f9e

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

modules/data/src/test/scala/shapeless3/data/monoidal.scala

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ object MonoidalTest {
4747
type pb = (Double, (Char, Unit))
4848
type pc = ("i", ("s", ("b", Unit)))
4949
type pd = ((Int, (String, Unit)), ((Boolean, Unit), (Unit, ((Double, (Char, Unit)), Unit))))
50+
/*
5051
summon[pairs.length[p] =:= 3]
5152
summon[pairs.reverse[p] =:= (Boolean, (String, (Int, Unit)))]
5253
summon[pairs.map[p][Option] =:= (Option[Int], (Option[String], (Option[Boolean], Unit)))]
@@ -129,4 +130,5 @@ object MonoidalTest {
129130
summon[coproduct.flatten[cd] =:= Cp[T[Int, T[String, T[Boolean, T[Double, T[Char, U]]]]]]]
130131
summon[coproduct.flatMap[cb][orIntc] =:= Cp[T[Double, T[Int, T[Char, T[Int, U]]]]]]
131132
summon[coproduct.select[c, 1] =:= Cp[T[String, T[Int, T[Boolean, U]]]]]
133+
*/
132134
}

modules/deriving/src/test/scala/shapeless3/deriving/adts.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,24 @@ package shapeless3.deriving
2121
object adts {
2222
case class ISB(i: Int, s: String, b: Boolean) derives Monoid, Eq, Empty, Show, Read
2323

24-
case class Box[A](x: A) derives Monoid, Eq, Show, Read, Functor, Pure
24+
case class Box[A](x: A) derives Monoid, Eq, Show, Read /*, Functor, Pure*/
2525

2626
sealed trait OptionInt derives Eq, Empty, Show, Read
2727
case class SomeInt(value: Int) extends OptionInt
2828
case object NoneInt extends OptionInt
2929

30-
sealed trait Opt[+A] derives Eq, Show, Read, Functor, EmptyK, Pure
30+
sealed trait Opt[+A] derives Eq, Show, Read /*, Functor, EmptyK, Pure*/
3131
case class Sm[+A](value: A) extends Opt[A]
3232
case object Nn extends Opt[Nothing]
3333

34-
sealed trait CList[+A] derives Eq, Show, Read, Functor, EmptyK
34+
sealed trait CList[+A] derives Eq, Show, Read /*, Functor, EmptyK*/
3535
case class CCons[+A](hd: A, tl: CList[A]) extends CList[A]
3636
case object CNil extends CList[Nothing]
3737

3838
case class Order[F[_]](
3939
item: F[String],
4040
quantity: F[Int]
41-
) derives FunctorK
41+
) // derives FunctorK
4242

4343
sealed trait OptionD[T] {
4444
def fold: T = this match {
@@ -53,7 +53,7 @@ object adts {
5353
case class Given[T](value: T) extends OptionD[T]
5454
case class Default[T](value: T) extends OptionD[T]
5555

56-
sealed trait ListF[+A, +R] derives Bifunctor
56+
sealed trait ListF[+A, +R] // derives Bifunctor
5757
object ListF {
5858
type List[A] = Fix[ListF, A]
5959
}

modules/deriving/src/test/scala/shapeless3/deriving/deriving.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class DerivationTests {
7878
assert(!v8.eqv(CCons(1, CCons(2, CCons(3, CNil))), CCons(1, CCons(4, CCons(3, CNil)))))
7979
}
8080

81+
/*
8182
@Test
8283
def functor: Unit = {
8384
val v0 = Functor[Box]
@@ -115,6 +116,7 @@ class DerivationTests {
115116
val v3: ListF.List[Int] = Fix(ConsF(3, Fix(ConsF(4, Fix(ConsF(6, Fix(NilF)))))))
116117
assert(Bifunctor.map((_: String).length)(v2) == v3)
117118
}
119+
*/
118120

119121
@Test
120122
def data: Unit = {
@@ -144,6 +146,7 @@ class DerivationTests {
144146
assert(v0.empty == ISB(0, "", false))
145147
}
146148

149+
/*
147150
@Test
148151
def emptyk: Unit = {
149152
val v0 = EmptyK[Opt]
@@ -159,6 +162,7 @@ class DerivationTests {
159162
val v1 = Pure[CList]
160163
assert(v1.pure(23) == CCons(23, CNil))
161164
}
165+
*/
162166

163167
@Test
164168
def labels: Unit = {

0 commit comments

Comments
 (0)