Created
February 28, 2021 11:21
-
-
Save ajrnz/7f6ad6975d2221c58319da3ddd71124f to your computer and use it in GitHub Desktop.
Macro Testing
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
package ajr.scala3test | |
import upickle.default.{macroRW, readwriter, ReadWriter => RW, Writer} | |
abstract class MyObject: | |
val ref: String | |
inline def macroCall(inline args: Any*): String = ${ callImpl('this, 'args) } | |
class Thing(val ref: String) extends MyObject: | |
def something(i: Int, d: Double, s: String) = macroCall(i: Int, d: Double, s: String) // Why do I need the types here? | |
object TestApp: | |
def main(args: Array[String]): Unit = | |
val res = Thing("aref").something(3, 3.14, "pi") | |
println(s"res=$res") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment