sealerate
sealerate copied to clipboard
Set of case objects defined inside a class returns empty
Hi,
First of all: amazing macro, it really helps get rid of large amounts of code.
Second, I wondered if there was a way to make it iterate over case objects of a sealed abstract class within another sealed abstract class. At the moment, running it within the "main" abstract class generates an empty Set. Running it outside the "main" abstract class will generate a type mismatch error. Example code:
sealed abstract class MainClass {
val mainData: Seq[Int] = Seq(1,2,3,4,5)
val allColuserdCaseObjects: Set[ClosuredClass] = sealerate.values[ClosuredClass]
sealed abstract class ClosuredClass {
lazy val closuredData: Int = mainData.length
}
}
I would like to get a Set for all the MainClass case objects if running outside of MainClass, and a Set of all ClosuredClass case objects if running within the MainClass (see allClosuredCaseObjects
variable).
Thanks Asaf