I try get head type and write it to List
transparent inline def getClassesFieldType[A](using p: Mirror.ProductOf[A]): List[String] =
inline p match {
case m: Mirror.ProductOf[A] =>
summonFieldTypes[m.MirroredElemTypes]
}
transparent inline def summonFieldTypes[T <: Tuple]: List[String] =
inline erasedValue[T] match {
case _: (head *: tail) =>
case _ => Nil
}
i try this
transparent inline def getClassesFieldType[A](using p: Mirror.ProductOf[A]): List[String] =
inline p match {
case m: Mirror.ProductOf[A] =>
summonFieldTypes[m.MirroredElemTypes]
}
transparent inline def summonFieldTypes[T <: Tuple]: List[String] =
inline erasedValue[T] match {
case _: (head *: tail) =>
summonInline[head].toString :: summonFieldTypes[tail]
case _ => Nil
}
also i try this
transparent inline def getClassesFieldType[A](using p: Mirror.ProductOf[A]): List[String] =
inline p match {
case m: Mirror.ProductOf[A] =>
summonFieldTypes[m.MirroredElemTypes]
}
transparent inline def summonFieldTypes[T <: Tuple]: List[String] =
inline erasedValue[T] match {
case _: (head *: tail) =>
constValue[head].toString :: summonFieldTypes[tail]
case _ => Nil
}
but this dont work because different excaption like No given instance of type String was found getClassesFieldType[Tester] or not a constant type: String; cannot take constValue getClassesFieldType[Tester]
after 4 hours and after 5 minutes after post i did this