-
-
Save DmytroMitin/a95c9fa500c6129f8143690835046cff to your computer and use it in GitHub Desktop.
dotty macros
This file contains 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
object App { | |
def main(args: Array[String]): Unit = { | |
App1.hello() | |
} | |
} |
This file contains 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
import scala.quoted._ | |
object App1 { | |
inline def hello(): Unit = ~ helloImpl() | |
def helloImpl(): Expr[Unit] = '{ println("Hello") } | |
} |
This file contains 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
dotc App1.scala | |
dotc App.scala | |
scala App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment