All Downloads are FREE. Search and download functionalities are using the official Maven repository.

camundala.bpmn.FieldNamesOf.scala Maven / Gradle / Ivy

There is a newer version: 1.30.23
Show newest version
package camundala.bpmn

import scala.quoted.*

object FieldNamesOf:

  def allFieldNames[T: Type](using Quotes): Expr[Seq[String]] =
    import quotes.reflect.*
    val tpe = TypeRepr.of[T]
    val fields =
      if tpe.typeSymbol.children.isEmpty then
        tpe.typeSymbol.primaryConstructor.paramSymss.flatten.map(_.name)
      else
        tpe.typeSymbol.children.flatMap: child =>
          child.primaryConstructor.paramSymss.flatten.map(_.name)

    Expr(fields)
  end allFieldNames
end FieldNamesOf




© 2015 - 2025 Weber Informatics LLC | Privacy Policy