Last active
April 1, 2023 10:56
-
-
Save zeptometer/67fc0d8e8ff2c1353eb22a99e23c62fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def app = hoge((y) => y + 1) // expected true, but got false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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