Skip to content

Commit

Permalink
Merge pull request #184 from adelbertc/macro-import
Browse files Browse the repository at this point in the history
Fully qualify values in CodecJson.derive macro
  • Loading branch information
tonymorris committed Jul 6, 2015
2 parents 4f13900 + 31c1bec commit c38a3d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/scala/argonaut/internal/Macros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ object Macros extends MacrosCompat {
val encode = materializeEncodeImpl[T](c)
val decode = materializeDecodeImpl[T](c)
c.Expr[CodecJson[T]](q"""
CodecJson.derived[$tpe]($encode, $decode)
_root_.argonaut.CodecJson.derived[$tpe]($encode, $decode)
""")
}

Expand All @@ -38,7 +38,7 @@ object Macros extends MacrosCompat {
}
val methodName = createTermName(c)("jencode" + (fieldCount.toString) + "L")
val expr = c.Expr[EncodeJson[T]]{q"""
EncodeJson.$methodName[$tpe, ..$fieldTypes](toEncode => (..$invocations))(..$decodedNames)
_root_.argonaut.EncodeJson.$methodName[$tpe, ..$fieldTypes](toEncode => (..$invocations))(..$decodedNames)
"""}
//println(expr)
expr
Expand Down Expand Up @@ -74,12 +74,12 @@ object Macros extends MacrosCompat {
}
val methodName = createTermName(c)("jdecode" + (fieldCount.toString) + "L")
val expr = c.Expr[DecodeJson[T]]{q"""
DecodeJson.$methodName[..$fieldTypes, $tpe]((..$functionParameters) => new $tpe(..$parameters))(..$decodedNames)
_root_.argonaut.DecodeJson.$methodName[..$fieldTypes, $tpe]((..$functionParameters) => new $tpe(..$parameters))(..$decodedNames)
"""}
//println(expr)
expr
}
case None => c.abort(c.enclosingPosition, "Could not identify primary constructor for " + tpe)
}
}
}
}

0 comments on commit c38a3d9

Please sign in to comment.