Skip to content

Commit 5c59097

Browse files
authored
Merge pull request #1167 from joroKr21/tuple-ops
Revert source breaking change in TupleOps
2 parents dd765c5 + 893a00c commit 5c59097

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

core/src/main/scala/shapeless/syntax/std/tuples.scala

+3-5
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,16 @@ package std
2121
import shapeless.ops.hlist.ProductToHList
2222

2323
trait LowPriorityTuple {
24-
@deprecated("Ambiguous with productOps", "2.3.5")
25-
def productTupleOps[P <: Product](p: P): TupleOps[P] = new TupleOps(p)
24+
implicit def productTupleOps[P <: Product](p: P): TupleOps[P] = new TupleOps(p)
2625
}
2726

2827
object tuple extends LowPriorityTuple {
29-
@deprecated("Redundant with tupleOps", "2.3.5")
30-
def unitTupleOps(u: Unit): TupleOps[Unit] = new TupleOps(u)
28+
implicit def unitTupleOps(u: Unit): TupleOps[Unit] = new TupleOps(u)
3129

3230
// Duplicated here from shapeless.HList so that explicit imports of tuple._ don't
3331
// clobber the conversion to HListOps.
3432
implicit def hlistOps[L <: HList](l : L) : HListOps[L] = new HListOps(l)
35-
implicit def tupleOps[P: IsTuple](p: P): TupleOps[P] = new TupleOps(p)
33+
private[shapeless] def tupleOps[P: IsTuple](p: P): TupleOps[P] = new TupleOps(p)
3634
}
3735

3836
final class TupleOps[T](t: T) extends Serializable {

core/src/test/scala/shapeless/tuples.scala

+1-8
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ class TupleTests {
14631463

14641464
@Test
14651465
def testPropagation: Unit = {
1466-
def useHead[P: IsTuple: IsComposite](p: P) = p.head
1466+
def useHead[P <: Product: IsComposite](p: P) = p.head
14671467
val h = useHead((23, "foo", true))
14681468
typed[Int](h)
14691469
}
@@ -1973,11 +1973,4 @@ class TupleTests {
19731973
(23, "foo").align[(String, String)]
19741974
""")
19751975
}
1976-
1977-
@Test
1978-
def testCompatibilityWithProductSyntax: Unit = {
1979-
import syntax.std.product._
1980-
assertEquals(List(2, "a"), Foo(2, "a").to[List])
1981-
assertEquals(List(2, "a"), (2, "a").to[List])
1982-
}
19831976
}

0 commit comments

Comments
 (0)