Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions core/src/main/scala/com/avsystem/commons/misc/Delegation.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,23 @@ package com.avsystem.commons
package misc

/** A typeclass which witnesses that type `A` can be wrapped into trait or abstract class `B`
*
* @deprecated
* `Delegation` is being removed in the Scala 3 release of scala-commons. The blackbox macros have no Scala 3
* counterpart; write the delegating wrapper manually (`new TargetTrait { def x = source.x; ... }`).
*/
@deprecated(
"Delegation will be removed in the Scala 3 release of scala-commons. Write the delegating wrapper manually.",
since = "2.29.0",
)
trait Delegation[A, B] {
def delegate(a: A): B
}

@deprecated(
"Delegation will be removed in the Scala 3 release of scala-commons. Write the delegating wrapper manually.",
since = "2.29.0",
)
object Delegation {
implicit def materializeDelegation[A, B]: Delegation[A, B] =
macro com.avsystem.commons.macros.misc.DelegationMacros.materializeDelegation[A, B]
Expand Down
Loading