We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5c06bd4 commit 5368179Copy full SHA for 5368179
tests/pos-macros/i16630.scala
@@ -1,6 +1,14 @@
1
import scala.language.experimental.macros
2
+import scala.quoted.{Quotes, Expr, Type}
3
-trait TraitWithTypeParam[A] {
4
- protected inline def foo: Option[A] = ${ ??? }
5
- protected def foo: Option[A] = macro ???
6
-}
+trait TraitWithTypeParam[A]:
+ inline def foo: Option[A] = ${ MacrosImpl.fooImpl[A] }
+ def foo: Option[A] = macro MacrosImpl.compatFooImpl[A]
7
+
8
+object MacrosImpl:
9
+ def fooImpl[A: Type](using quotes: Quotes): Expr[Option[A]] = ???
10
+ def compatFooImpl[A: c.WeakTypeTag](c: Context): c.Tree = ???
11
12
+trait Context:
13
+ type WeakTypeTag[A]
14
+ type Tree
0 commit comments