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

Stackoverflow when reading simple example in 0.2.0 #8

Closed
stevejb71 opened this issue Jul 27, 2014 · 5 comments
Closed

Stackoverflow when reading simple example in 0.2.0 #8

stevejb71 opened this issue Jul 27, 2014 · 5 comments

Comments

@stevejb71
Copy link

With Scala 2.11.2, on JDK 6, using upickle 0.2.0, this fails to compile with a StackOverflowError. Reverting to 0.1.7 has no error.

object bug {
case class Portfolio(trades: List[String])
upickle.readPortfolio
}

@lihaoyi
Copy link
Member

lihaoyi commented Jul 27, 2014

The last person who saw this didn't import upickle._. Could you try that and see if it fixes it? I think I know what the bug is: if you can't find implicits for something like List it falls back to macros, but it's recursively defined and so blows up. It really shouldn't blow up, but that will take some work with the macros to make it fail more elegantly

@stevejb71
Copy link
Author

import upickle._ does indeed cure it.

@lihaoyi
Copy link
Member

lihaoyi commented Jul 28, 2014

Ok cool. Let's leave this issue open just to remind myself that improving the error behavior is something that should happen at some point

@tindzk
Copy link
Contributor

tindzk commented Sep 7, 2014

Yesterday, I ran into the same bug after factoring out some code into a new module. I forgot to copy over the import upickle._. This went unnoticed as the compiler did not warn me. It would be tremendously helpful if the library could detect this kind of problem and print out an appropriate error. This could have saved me some time. :)

@lihaoyi
Copy link
Member

lihaoyi commented Sep 30, 2014

This seems to have gone away on its own in the latest version, though I have no idea how. Could you guys try again (the exact example above) and re-open the issue if it's still failing? For discussion on default-behavior-ness, let's do that over on #32

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

3 participants