diff --git a/library/src/scala/Eql.scala b/library/src/scala/Eql.scala index 36f2e7b764e6..28fab1fd0f54 100644 --- a/library/src/scala/Eql.scala +++ b/library/src/scala/Eql.scala @@ -23,15 +23,15 @@ object Eql { def eqlAny[L, R]: Eql[L, R] = derived // Instances of `Eql` for common Java types - implicit def eqlNumber : Eql[Number, Number] = derived - implicit def eqlString : Eql[String, String] = derived + given eqlNumber as Eql[Number, Number] = derived + given eqlString as Eql[String, String] = derived // The next three definitions can go into the companion objects of classes // Seq, Set, and Proxy. For now they are here in order not to have to touch the // source code of these classes - implicit def eqlSeq[T, U](implicit eq: Eql[T, U]): Eql[GenSeq[T], GenSeq[U]] = derived - implicit def eqlSet[T, U](implicit eq: Eql[T, U]): Eql[Set[T], Set[U]] = derived + given eqlSeq[T, U](using eq: Eql[T, U]) as Eql[GenSeq[T], GenSeq[U]] = derived + given eqlSet[T, U](using eq: Eql[T, U]) as Eql[Set[T], Set[U]] = derived // true asymmetry, modeling the (somewhat problematic) nature of equals on Proxies - implicit def eqlProxy : Eql[Proxy, AnyRef] = derived + given eqlProxy as Eql[Proxy, AnyRef] = derived } diff --git a/library/src/scala/implicits/Not.scala b/library/src/scala/implicits/Not.scala index 6c06444145fc..5ad640bb9bd9 100644 --- a/library/src/scala/implicits/Not.scala +++ b/library/src/scala/implicits/Not.scala @@ -7,8 +7,8 @@ package scala.implicits * value of type `C` is available. If we do not want to prioritize `i1` and `i2` by * putting them in different traits we can instead define the following: * - * implicit def i1: D(implicit ev: C) = ... - * implicit def i2: D(implicit ev: Not[C]) = ... + * given i1: D(using ev: C) = ... + * given i2: D(using ev: Not[C]) = ... * * `Not` is treated specially in implicit search, similar to the way logical negation * is treated in Prolog: The implicit search for `Not[C]` succeeds if and only if the implicit @@ -27,7 +27,7 @@ final class Not[+T] private () trait LowPriorityNot { /** A fallback method used to emulate negation in Scala 2 */ - implicit def default[T]: Not[T] = Not.value + given default[T] as Not[T] = Not.value } object Not extends LowPriorityNot { @@ -38,8 +38,8 @@ object Not extends LowPriorityNot { def value: Not[Nothing] = new Not[Nothing]() /** One of two ambiguous methods used to emulate negation in Scala 2 */ - implicit def amb1[T](implicit ev: T): Not[T] = ??? + given amb1[T](using ev: T) as Not[T] = ??? /** One of two ambiguous methods used to emulate negation in Scala 2 */ - implicit def amb2[T](implicit ev: T): Not[T] = ??? + given amb2[T](using ev: T) as Not[T] = ??? }