We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
3.3.5, 3.6.4, 3.7.0-RC1-bin-20250309-2f639e2-NIGHTLY
Lib.scala:
import scala.quoted.* class myAnnot extends scala.annotation.StaticAnnotation inline def myAnnotValue[A]: Option[String] = ${ myAnnotValueImpl[A] } def myAnnotValueImpl[A : Type](using Quotes): Expr[Option[String]] = Type.of[A] match case '[t @ `myAnnot`] => '{ Some("xyz") } case _ => '{ None }
Test.scala
@main def run() = println(myAnnotValue[Int]) println(myAnnotValue[Int @myAnnot])
Some(xyz) Some(xyz)
None Some(xyz)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Compiler version
3.3.5, 3.6.4, 3.7.0-RC1-bin-20250309-2f639e2-NIGHTLY
Minimized code
Lib.scala:
Test.scala
Output
Expectation
The text was updated successfully, but these errors were encountered: