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

PPrint derivation fails with nested class definitions #47

Closed
alexarchambault opened this Issue Apr 13, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@alexarchambault
Collaborator

alexarchambault commented Apr 13, 2015

REPL session with Ammonite 0.2.7:

@ object ODef { case class Foo(i: Int, s: String) }
defined object ODef
@ ODef.Foo(2, "ba") // Nested in object, succeeds
res1: cmd0.ODef.Foo = Foo(2, "ba")

@ class CDef { case class Foo(i: Int, s: String) }
defined class CDef
@ object CDef extends CDef
defined object CDef
@ CDef.Foo(2, "ba") // Nested in class implemented by object, fails
Compilation Failed
Main.scala:26: could not find implicit value for evidence parameter of type ammonite.pprint.PPrint[cmd3.CDef.Foo]
          def $main() = {Iterator(ReplBridge.shell.shellPPrint(res4, "res4")) ++ Iterator(" = ") ++ ammonite.pprint.PPrint(res4)}
                                                                                                                          ^

This can be reproduced out of the Ammonite REPL, see https://gist.github.com/alexarchambault/90f79a160eca9a9e6932.

Note that contrary to Ammonite macros, shapeless Generic succeeds in these two cases (in the gist too).

@lihaoyi

This comment has been minimized.

Owner

lihaoyi commented Apr 18, 2015

Fixed by c57eedd

@lihaoyi lihaoyi closed this Apr 18, 2015

@alexarchambault

This comment has been minimized.

Collaborator

alexarchambault commented Apr 18, 2015

Great, thanks!

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