-
Notifications
You must be signed in to change notification settings - Fork 1.1k
JVM crash: java.lang.VerifyError: Bad type on operand stack #14164
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
My copy/paste skills are getting rusty.
|
Reproducer
says
|
This looks like a duplicate of an issue I fixed recently. I verified that this works now. |
It still blows up for me: Welcome to Scala 3.1.3-RC1-bin-SNAPSHOT-nonbootstrapped-git-5626f25 (1.8.0_292, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
scala> class Base(a: String = "x", param: String = "")
|
| class Child extends Base(param = {
| (for(x <- Seq("a")) yield x)
| "param"
| })
|
| new Child
// defined class Base
// defined class Child
java.lang.VerifyError: Bad type on operand stack
Exception Details:
Location:
rs$line$1$Child.<init>()V @25: invokedynamic
Reason:
Type uninitializedThis (current frame, stack[1]) is not assignable to 'rs$line$1$Child'
Current Frame:
bci: @25
flags: { flagThisUninit }
locals: { uninitializedThis }
stack: { 'scala/collection/SeqOps', uninitializedThis }
Bytecode:
0x0000000: b200 13b6 0017 b200 1c04 bd00 1e59 0312
0x0000010: 2053 b600 24b6 002a 2aba 003e 0000 b900
0x0000020: 4402 0057 1246 4cb2 0049 b600 4d4d 2a2c
0x0000030: 2bb7 0050 b1
... 65 elided |
It compiles but my local dotty still says
where
I have not yet re-spooled whatever insight I may have had last year. I just typed in the command at the prompt. Oh, I guess it's a problem induced by scripting, because normally:
where my extra debug is unrelated. I added a println out of paranoia. |
I tried with a standalone application, not a script. @griggt @som-snytt Does that also crash for you? |
@griggt jinx. The other family members were shuffling out the door so I didn't hit the button first. Also I just re-re-ran with a clean repo, it fails only with |
So should this be area:repl then? |
The script runner is not the REPL! he said, defensively. unless @griggt has already fixed it, I'll take a look today. |
@som-snytt go for it! It seems to me that the failure only occurs in presence of the wrapper object injected by the REPL / Scastie? |
This is not just REPL, I am getting this error with production code. |
@strelec I will get back to this. To fail, it needs both the enclosing outer template and to force loading the I did check that Also the script runner is not the REPL. |
Super calls with default and named parameters can have lifted arguments in val defs preceding the constructor call. If these are complex, we need to hoist them out as well. Fixes scala#14164
I found the root cause: We forgot about lifted parameters when hoisting out supercall arguments. |
Super calls with default and named parameters can have lifted arguments in val defs preceding the constructor call. If these are complex, we need to hoist them out as well. Fixes scala#14164
Compiler version
3.1.0
Minimized code
It seems that a combination of two factors trigger this bug:
Output
Looks somewhat siliar to #2163
Expectation
Code runs with no output.
The text was updated successfully, but these errors were encountered: