Skip to content

Instantly share code, notes, and snippets.

@zeptometer
Last active April 1, 2023 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeptometer/67fc0d8e8ff2c1353eb22a99e23c62fb to your computer and use it in GitHub Desktop.
Save zeptometer/67fc0d8e8ff2c1353eb22a99e23c62fb to your computer and use it in GitHub Desktop.
def app = hoge((y) => y + 1) // expected true, but got false
inline def hoge(x: Int => Int) =
${ isLambda('x) }
def isLambda(x: Expr[Int => Int])(using Quotes): Expr[Boolean] =
x match
case '{ (y : Int) => $f(y) : Int } => '{ true }
case _ => '{ false }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment