Skip to content

Commit 269b350

Browse files
committed
Add test file
1 parent 567787f commit 269b350

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import scala.quoted.*
2+
3+
inline def annots(inline c: String): List[String] = ${ annotsImpl('c) }
4+
5+
def annotsImpl(c: Expr[String])(using Quotes): Expr[List[String]] =
6+
import quotes.reflect.*
7+
// println(c.valueOrError)
8+
val a = Symbol.requiredClass(c.valueOrError).declaredMethods.map(_.annotations.toString)
9+
// println(a)
10+
Expr(a)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
public class J {
2+
@SuppressWarnings(value = "a")
3+
public void f1() {}
4+
@SuppressWarnings("b")
5+
public void f2() {}
6+
@SuppressWarnings({"c", "d"})
7+
public void f3() {}
8+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@main def Test =
2+
println("adasdasdasdasdasdasdas")
3+
println(annots("J"))

0 commit comments

Comments
 (0)