Skip to content

Commit

Permalink
#44 fix compilation error on macro derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
eld0727 committed Mar 7, 2019
1 parent 9816a02 commit 218cf1b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lazy val scalaTestVersion = "3.0.5"

lazy val commonSettings = Seq(
version := "0.9.0",
version := "0.9.0.1",
organization := "com.tethys-json",
scalaVersion := "2.11.12",
crossScalaVersions := Seq("2.11.12", "2.12.8", "2.13.0-M2"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ trait ReaderDerivation
def deriveReader[A: WeakTypeTag](description: ReaderMacroDescription): Expr[JsonReader[A]] = {
val tpe = weakTypeOf[A]
val classDef = caseClassDefinition(tpe)
val config = c.eval(description.config)
val config = scala.util.Try(c.eval(description.config)).getOrElse(c.eval(description.config))

val readerFields = applyFieldStyle(config.fieldStyle)
.andThen(applyOperations(description.operations))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ trait WriterDerivation

def deriveWriter[A: WeakTypeTag](description: MacroWriteDescription): Expr[JsonObjectWriter[A]] = {
val tpe = description.tpe
val config = c.eval(description.config)
val config = scala.util.Try(c.eval(description.config)).getOrElse(c.eval(description.config))
val writerFields = applyFieldStyle(config.fieldStyle)
.andThen(applyDescriptionOperations(description.operations))
.apply(makeFields[A])
Expand Down

0 comments on commit 218cf1b

Please sign in to comment.