-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Compiling code with Enums in without doing a clean compile causes runtime VerifyError #6664
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
Can you provide a minimal project that reproduces the problem ? |
Here you go! This is a fun one! Two files are necessary, no cross-compilation necessary. bash> sbt This should run fine and produce "ok!". Now edit Detonator.scala by adding whitespace or something. Run the following: sbt> compile And boom!
|
Ok so I found that under incremental compilation, Detonator.boom is rewritten as shown by this diff: @@ -114,10 +114,10 @@ public final class foo.Detonator$ implements scala.Serializable
public void boom();
descriptor: ()V
flags: ACC_PUBLIC
Code:
stack=2, locals=1, args_size=1
0: getstatic #31 // Field foo/Bomb$.MODULE$:Lfoo/Bomb$;
3: ldc #33 // String Kaboom
- 5: invokevirtual #39 // Method foo/Bomb$.valueOf:(Ljava/lang/String;)Lfoo/Bomb;
+ 5: invokevirtual #39 // Method foo/Bomb.valueOf:(Ljava/lang/String;)Lfoo/Bomb;
8: pop
9: return The rewritten code tries to |
Any progress on this issue? This should fix my issue with serialization and allow all my tests to pass. |
When compiling code with Enums, unless a clean compile is done, then at runtime when an Enum is encountered (for example, here I have an
enum Operator ...
) an error like the following is triggered:This is running 0.16.0-RC3 cross compiling with a 2.12.8 library.
The text was updated successfully, but these errors were encountered: