Skip to content

Commit

Permalink
fix scala 2.11 having problems finding default values of nested case …
Browse files Browse the repository at this point in the history
…classes because of uninitialized types
  • Loading branch information
zzeekk committed Apr 18, 2021
1 parent f09361d commit b098fba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion core/src/main/scala/configs/macros/Construct.scala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ trait Construct {
}
}

private def defaults(a: ClassSymbol, m: MethodSymbol): Map[Int, ModuleMethod] =
private def defaults(a: ClassSymbol, m: MethodSymbol): Map[Int, ModuleMethod] = {
a.typeSignature // force initialize type metadata, otherwise some attributes are empty/false, e.g. isCaseClass, knownDirectSubclasses
a.companion match {
case cmp if cmp.isModule =>
val mod = cmp.asModule
Expand All @@ -99,6 +100,7 @@ trait Construct {
}.toMap
case _ => Map.empty
}
}

private def caseClass(a: ClassSymbol, isSealedMember: Boolean = false): CaseClass = {
val tpe = a.toType
Expand Down

0 comments on commit b098fba

Please sign in to comment.