Skip to content
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

Macro expansion error is breaking during pretty print #455

mateor opened this issue Aug 30, 2016 · 2 comments

Macro expansion error is breaking during pretty print #455

mateor opened this issue Aug 30, 2016 · 2 comments


Copy link

mateor commented Aug 30, 2016

So, I don't have a good idea of the internals here yet. But I am experimenting with the Ammonite Repl 0.7.5 and really like it. But I hit a breakage.

My trace looks something like this:

@ val my_user = my.mongo.record("a_user").get
my_user: User <etc>
@ my_user.recordDetails.getCertainDetails exception during macro expansion:
java.lang.AssertionError: assertion failed: mkAttributedQualifier(my.mongo.record, <none>)
    at scala.reflect.internal.TreeGen.mkAttributedQualifier(TreeGen.scala:86)
    at scala.reflect.internal.TreeGen.mkAttributedQualifier(TreeGen.scala:62)
    at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:122)
    at scala.reflect.internal.Internals$$anon$4.mkAttributedRef(Internals.scala:151)
    at scala.reflect.internal.Internals$$anon$4.mkAttributedRef(Internals.scala:148)
    at derive.Derive.deriveObject(Derive.scala:358)
    at derive.Derive$$anonfun$9.apply(Derive.scala:238)
    at derive.Derive$$anonfun$9.apply(Derive.scala:235)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
    at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
    at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
    at scala.collection.TraversableLike$
    at derive.Derive.deriveType(Derive.scala:235)
    at derive.Derive.derive(Derive.scala:60)
    at pprint.Internals$LowerPriPPrint$.liftedTree1$1(PPrint.scala:408)
    at pprint.Internals$LowerPriPPrint$.FinalRepr(PPrint.scala:408)
    at sun.reflect.GeneratedMethodAccessor11.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:34)
    at scala.reflect.macros.runtime.JavaReflectionRuntimes$JavaReflectionResolvers$$anonfun$resolveJavaReflectionRuntime$2.apply(JavaReflectionRuntimes.scala:22)

            .print(res12, res12, "res12", _root_.scala.None)
Compilation Failed

This only happens in a chained invocation, for instance the following works

@ my_user.recordDetails
res2: recordDetails = <details>
@ res2.getCertainDetails
res3: res2.getCertainDetails.type = Map(<etc>)

I saw some potentially related issues, but they are all marked solved. So I checked if it was a regression and at least com-lihaoyi/upickle#92 appears to be live again, or at least a possibly related error occurs.

(gist used since the trace is so long:

Copy link

lihaoyi commented May 18, 2017

Should be fixed by 662859f

@lihaoyi lihaoyi closed this as completed May 18, 2017
Copy link

lihaoyi commented May 21, 2017 is out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants