-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make-macro behaves unexpectedly with jsoniter-scala #1206
Comments
//cc @plokhotnyuk do you see something obvious here? If I don't do the allocation (e.g. the first or second codec), I'll get
|
the def make(value: A): Validation[String, Type] = macro zio.prelude.Macros.make_impl[A, Type] which continues like this: def make_impl[A, T](value: c.Expr[A]): c.Tree = {
val expr = value
val result = q"_root_.zio.prelude.Newtype.unsafeWrap(${c.prefix})($expr)"
q"""
_root_.zio.prelude.Validation.fromEitherNonEmptyChunk {
${c.prefix}.assertion.run($value)
.left.map(e => _root_.zio.NonEmptyChunk.fromCons(e.toNel($value.toString)))
}.as($result)
"""
} is it possible that the expression |
not working at runtime:
also not working at runtime (type hint):
Working at runtime (explicit variable declaration before macro call:
Testcase:
The text was updated successfully, but these errors were encountered: