Skip to content

Commit 0db6cde

Browse files
committed
Remove the Eql instance for Proxy.
`Proxy` is deprecated in Scala 2.13. We should not burden the newly introduced `Eql` with an instance for it.
1 parent 81bb6c0 commit 0db6cde

File tree

3 files changed

+2
-13
lines changed

3 files changed

+2
-13
lines changed

library/src/scala/Eql.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ object Eql {
2727
given eqlString as Eql[String, String] = derived
2828

2929
// The next three definitions can go into the companion objects of classes
30-
// Seq, Set, and Proxy. For now they are here in order not to have to touch the
30+
// Seq and Set. For now they are here in order not to have to touch the
3131
// source code of these classes
3232
given eqlSeq[T, U](using eq: Eql[T, U]) as Eql[Seq[T], Seq[U]] = derived
3333
given eqlSet[T, U](using eq: Eql[T, U]) as Eql[Set[T], Set[U]] = derived
34-
35-
// true asymmetry, modeling the (somewhat problematic) nature of equals on Proxies
36-
given eqlProxy as Eql[Proxy, AnyRef] = derived
3734
}

tests/neg/equality.scala

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ object equality {
1414
implicit def eqNum: Eql[Num, Num] = Eql.derived
1515
implicit def eqOption[T, U](implicit e: Eql[T, U]): Eql[Option[T], Option[U]] = Eql.derived
1616

17-
case class PString(a: String) extends Proxy {
18-
def self = a
19-
}
20-
2117
/*
2218
implicit def eqString: Eql[String, String] = Eql.derived
2319
implicit def eqInt: Eql[Int, Int] = Eql.derived
@@ -84,9 +80,6 @@ object equality {
8480
i == bi
8581
bi == i
8682

87-
val ps = PString("hello")
88-
ps == "world"
89-
9083
n match {
9184
case None => // error
9285
}
@@ -110,7 +103,6 @@ object equality {
110103
1 == "abc" // error
111104
"abc" == bi // error
112105
bi == "abc" // error
113-
"world" == ps // error
114106

115107
val s1 = Set(1, 2, 3)
116108
val s2 = Set()

tests/run/proxy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ object Test extends App {
1313

1414
val label = Bippy("bippy!")
1515
println(label == label)
16-
println(label == "bippy!")
16+
println((label: Any) == ("bippy!": Any))
1717
}

0 commit comments

Comments
 (0)