-
-
Notifications
You must be signed in to change notification settings - Fork 107
Strange ClassCastException #104
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
Comments
So the line it thinks are bad is my |
Hi, Stephen! Thanks for reporting! I have reproduced that exception in the following test: 37b9f29#diff-7f1e691cb8eee9823fc1e4df91e30c44R9 Also, I see that the generated codec, that you have reported above doesn't throw that error, instead it throws another:
And the same error for unexpected field I can get when turning off
|
I have reproduced that So it looks more like a bug of the scalac (I've opened an issue for that scala/bug#10825 ), but I will investigate further. |
I've mitigated that compiler bug by renaming of Now tests are failing due unexpected array JSON value, while a JSON object is expected as stated in the case class (
|
Changed the issue type to |
Another w/a for the scalac bug is to move a definition of the field with encoded chars ( |
@plokhotnyuk thank you very much for the super fast turn around I appreciate it! So I think Scala 2.12.6 is slated to come out very soon from the macro regression, so it would seem the compiler bug won't be fixed for sometime. I don't even know if it'll get into 2.12.7. So what do you want to do with this issue? Do you want me to leave it open as an FYI for maybe someone else coming along who has this problem or just close it? The work around solved what I was trying to do so at least there is a solution for the time being. Other than that if you wanted some real world benchmarks of your library, I wrote some to see how the new JSON parser held up against my old parser, which was Json4s using Jackson.
This is JDK8 and Scala 2.12.4. |
Hi, Stephen! Thanks for your feedback! Feel free to close the issue if you got an answer that satisfied your needs. I'll add the Also, I'm going to add the I believe that jsoniter-scala will save lot of your time & money for JSON processing. It shines especially when you do not need to hold all JSON data in memory:
BTW, in your benchmarks jsoniter-scala do decoding/encoding of UTF-8 bytes, while other library works with UTF-16 encoded strings instead. Also, a manual call of the blackhole consume is not required if you return all results from the benchmark method (check generated sources in |
Hi, I'm trying to use this library to derive encoders for the crossref API.
Exception in thread "main" java.lang.ClassCastException: java.lang.Integer cannot be cast to scala.collection.Seq
is the error I get.
The JSON coming back is
and my case classes
Finally here is the generated parser
I really have no idea how to debug this, so I'm just dumping what I know I have. Is there a better way to debug this? My case classes were derived from https://github.com/CrossRef/rest-api-doc/blob/master/api_format.md
The text was updated successfully, but these errors were encountered: