File tree Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Expand file tree Collapse file tree 3 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1717 |Inline stack trace
1818 |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1919 |This location contains code that was inlined from Test.scala:5
20- 5 | implicit inline def implicitMakeSerializer [T]: Serializer[T] = ${ Macros.makeSerializer[T] }
21- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20+ 5 | inline given [T] => Serializer[T] = ${ Macros.makeSerializer[T] }
21+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2222 ---------------------------------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import scala.annotation.{experimental, targetName}
22import scala .quoted .*
33import scala .util .Try
44
5- object Macros {
6- def makeSerializer [T : Type ](using Quotes ): Expr [Serializer [T ]] = {
5+ object Macros :
6+ def makeSerializer [T : Type ](using Quotes ): Expr [Serializer [T ]] =
77 import quotes .reflect .*
88
99 val tpe : TypeRepr = TypeRepr .of[T ]
@@ -12,7 +12,7 @@ object Macros {
1212 val modSym : Symbol = Symbol .newModule(
1313 Symbol .spliceOwner,
1414 name,
15- Flags .Implicit ,
15+ Flags .Given ,
1616 Flags .EmptyFlags ,
1717 _ => List (TypeRepr .of[Object ], TypeRepr .of[Serializer [T ]]),
1818 _ => Nil ,
@@ -23,5 +23,3 @@ object Macros {
2323 ClassDef .module(modSym, List (TypeTree .of[Serializer [T ]]), Nil )
2424
2525 Block (List (modValDef, modClassDef), Ref (modSym)).asExprOf[Serializer [T ]]
26- }
27- }
Original file line number Diff line number Diff line change 22trait Serializer [@ specialized T ]
33
44object Serializer :
5- implicit inline def implicitMakeSerializer [T ]: Serializer [T ] = $ { Macros .makeSerializer[T ] }
5+ inline given [T ] => Serializer [T ] = $ { Macros .makeSerializer[T ] }
66
77case class ValidationCls (string : String )
88
9- @ main def Test = summon[Serializer [ValidationCls ]] // error
9+ @ main def Test = summon[Serializer [ValidationCls ]] // error
You can’t perform that action at this time.
0 commit comments