Match Types with Structural Types

transparent inline methods do not really provide an ergonomic use for type macro - e.g. you need to cache the result in a variable to extract the type

class TpMacro[Res] {
  type Result = Res
}

transparent inline def macroType: TpMacro[?] = new TpMacro[("foo", 1, "bar", true)]

val res =  macroType
type Fields = res.Result

val fields: Fields = ("foo", 1, "bar", true)
3 Likes