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
// TestMacro.scala | |
import scala.quoted.* | |
object TestMacro { | |
inline def name[E](e: E): String = ${ nameImpl[E]('e) } | |
def nameImpl[E: Type](e: Expr[E])(using Quotes): Expr[String] = { | |
import quotes.reflect.* |
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
import scala.annotation.implicitNotFound | |
import scala.language.implicitConversions | |
object hset extends App { | |
type ??? = Nothing | |
// Set(1, 2, 3) Set of ints | |
// Set("Adam", "Kit") Set of strings | |
// "Adam" :*: 1 :*: true :*: HNil |