Skip to content

Instantly share code, notes, and snippets.

@chandu0101
Last active August 29, 2015 14:23
Show Gist options
  • Save chandu0101/7d0267e9de320097222c to your computer and use it in GitHub Desktop.
Save chandu0101/7d0267e9de320097222c to your computer and use it in GitHub Desktop.
trait CommonValueClass extends Any
class Type1 private(val name : String) extends CommonValueClass
object Type1 {
val SCALA = new Type1("scala")
}
class Type2 private(val option : String) extends CommonValueClass
object Type2 {
val LEFT = new Type2("left")
}
// my classes
case class Test1(optionType : Type2)
case class Test2(nameType : Type1)
i want to generate some code for these classes based on params using macros
is it possible to get the public porperty of value classes in generic way ?
or i must define abstract method getValue in CommonValueClass trait ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment