We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b1380ed commit f6231ecCopy full SHA for f6231ec
tests/run-custom-args/i12352/Macro.scala
@@ -0,0 +1,8 @@
1
+import scala.quoted.*
2
+
3
+inline def getDocString[T]: Option[String] = ${ getDocStringImpl[T] }
4
5
+private def getDocStringImpl[T : Type](using Quotes): Expr[Option[String]] = {
6
+ import quotes.reflect.*
7
+ Expr(TypeRepr.of[T].typeSymbol.docstring)
8
+}
tests/run-custom-args/i12352/Main.scala
@@ -0,0 +1,5 @@
+@main def Test(): Unit = {
+ val res = getDocString[scala.quoted.Quotes]
+ println(res)
+ assert(res.nonEmpty)
0 commit comments