diff --git a/MIGRATION.md b/MIGRATION.md index b99395701..a18c82b78 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -18,6 +18,7 @@ the bottom of this file. Restoration ships incrementally per feature area. | `-Wconf` warning suppression blocks | Project rule: fix warnings at source, not via suppression. | | `-language:experimental.macros` | Scala 3 uses `inline` + `scala.quoted`; flag is a no-op. | | Scala 2 macro impls (`c.universe`, blackbox/whitebox) | Replaced by Scala 3 quotes/inline during feature-area restoration; the legacy `commons-macros` module is gone. | +| `misc/Delegation` | Scala 2 blackbox macro deleted from the Scala 3 tree (file + test removed). Restoration not planned: write the delegating wrapper manually (`new TargetTrait { def x = source.x; ... }`). A `@deprecated` shim shipping in the parallel Scala 2 `master` PR gives downstream a warning window before the symbol disappears. | ## 2. Deprecated on Scala 3 @@ -159,8 +160,6 @@ Full per-file list with locations is in the Backlog table below (filter rows whe | `core/src/main/scala/com/avsystem/commons/misc/ApplierUnapplier.scala:25` | Unapplier.materialize (Scala 2 macro def) | L | | `core/src/main/scala/com/avsystem/commons/misc/ApplierUnapplier.scala:37` | ApplierUnapplier.materialize (Scala 2 macro def) | L | | `core/src/main/scala/com/avsystem/commons/misc/Bidirectional.scala:6` | apply (Scala 2 macro def) | L | -| `core/src/main/scala/com/avsystem/commons/misc/Delegation.scala:11` | materializeDelegation (Scala 2 macro def) | L | -| `core/src/main/scala/com/avsystem/commons/misc/Delegation.scala:21` | CurriedDelegation.apply (Scala 2 macro def) | L | | `core/src/main/scala/com/avsystem/commons/misc/Implicits.scala:5` | infer (Scala 2 macro def) | L | | `core/src/main/scala/com/avsystem/commons/misc/Implicits.scala:7` | infer(clue) (Scala 2 macro def) | L | | `core/src/main/scala/com/avsystem/commons/misc/Implicits.scala:9` | inferNonMacro (Scala 2 macro def) | L | diff --git a/core/src/main/scala/com/avsystem/commons/misc/Delegation.scala b/core/src/main/scala/com/avsystem/commons/misc/Delegation.scala deleted file mode 100644 index dcd8f8e24..000000000 --- a/core/src/main/scala/com/avsystem/commons/misc/Delegation.scala +++ /dev/null @@ -1,24 +0,0 @@ -package com.avsystem.commons -package misc - -/** A typeclass which witnesses that type `A` can be wrapped into trait or abstract class `B` - */ -trait Delegation[A, B] { - def delegate(a: A): B -} - -object Delegation { - // TODO[scala3-port]: materializeDelegation (Scala 2 macro def) (L) - implicit def materializeDelegation[A, B]: Delegation[A, B] = ??? - - /** Provides following syntax: - * - * Delegation[TargetType](value) - */ - def apply[B] = new CurriedDelegation[B] - - class CurriedDelegation[B] { - // TODO[scala3-port]: CurriedDelegation.apply (Scala 2 macro def) (L) - def apply[A](source: A): B = ??? - } -} diff --git a/core/src/test/scala/com/avsystem/commons/misc/DelegationTest.scala b/core/src/test/scala/com/avsystem/commons/misc/DelegationTest.scala deleted file mode 100644 index 1d0c0d966..000000000 --- a/core/src/test/scala/com/avsystem/commons/misc/DelegationTest.scala +++ /dev/null @@ -1,33 +0,0 @@ -package com.avsystem.commons -package misc - -import org.scalatest.funsuite.AnyFunSuite - -class DelegationTest extends AnyFunSuite { - trait Destination[T] { - val te: T - def simple(omg: Int): String - def meth[C[+X] >: Null <: Iterable[X]](map: Map[T, C[String]]): C[(T, String)] - def multi(a: String)(b: String): String - def vararg(values: String*): String - } - - class Source { - val te: Double = 3.14 - def simple(omg: Int): String = omg.toString - def meth[C[+X] >: Null <: Iterable[X]](map: Map[Double, C[String]]): C[(Double, String)] = null - def multi(a: String)(b: String): String = a + b - def vararg(values: String*): String = values.mkString("") - } - - test("simple test") { - val source = new Source - val destination = Delegation[Destination[Double]](source) - - assert(source.te == destination.te) - assert(source.simple(42) == destination.simple(42)) - assert(source.meth[List](Map.empty) == destination.meth[List](Map.empty)) - assert(source.multi("4")("2") == destination.multi("4")("2")) - assert(source.vararg("4", "2") == destination.vararg("4", "2")) - } -}