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

PPrint derivation fails with nested class definitions #47

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

PPrint derivation fails with nested class definitions #47

alexarchambault opened this issue Apr 13, 2015 · 2 comments

Comments

@alexarchambault
Copy link
Collaborator

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
Copy link
Member

lihaoyi commented Apr 18, 2015

Fixed by c57eedd

@lihaoyi lihaoyi closed this as completed Apr 18, 2015
@alexarchambault
Copy link
Collaborator Author

Great, thanks!

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

No branches or pull requests

2 participants