Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce @flatten annotation #642

Merged
merged 25 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ trait MacroImplicits extends MacrosCommon { this: upickle.core.Types =>
def macroW[T]: Writer[T] = macro MacroImplicits.applyW[T]
def macroRW[T]: ReadWriter[T] = macro MacroImplicits.applyRW[ReadWriter[T]]

def macroR0[T, M[_]]: Reader[T] = macro internal.Macros.macroRImpl[T, M]
def macroW0[T, M[_]]: Writer[T] = macro internal.Macros.macroWImpl[T, M]
def macroR0[T, M[_]]: Reader[T] = macro internal.Macros2.macroRImpl[T, M]
def macroW0[T, M[_]]: Writer[T] = macro internal.Macros2.macroWImpl[T, M]
}

Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ import upickle.implicits.{MacrosCommon, key}
import language.higherKinds
import language.existentials

/**
* This file is deprecated and remained here for binary compatibility.
* Please use upickle/implicits/src-2/upickle/implicits/internal/Macros2.scala instead.
*/

/**
* Implementation of macros used by uPickle to serialize and deserialize
* case classes automatically. You probably shouldn't need to use these
Expand Down Expand Up @@ -466,6 +471,8 @@ object Macros {
q"${c.prefix}.Writer.merge[$targetType](..$subtree)"
}
}

@deprecated("Use Macros2 instead")
def macroRImpl[T, R[_]](c0: scala.reflect.macros.blackbox.Context)
(implicit e1: c0.WeakTypeTag[T], e2: c0.WeakTypeTag[R[_]]): c0.Expr[R[T]] = {
import c0.universe._
Expand All @@ -477,6 +484,7 @@ object Macros {
c0.Expr[R[T]](res)
}

@deprecated("Use Macros2 instead")
def macroWImpl[T, W[_]](c0: scala.reflect.macros.blackbox.Context)
(implicit e1: c0.WeakTypeTag[T], e2: c0.WeakTypeTag[W[_]]): c0.Expr[W[T]] = {
import c0.universe._
Expand Down
Loading
Loading