Open exFalso opened 7 years ago
With which Quasar version does it happen? I couldn't reproduce it with 0.7.9
and Kotlin 1.1.51
.
I tried it with Quasar 0.7.9
and Kotlin 1.1.51
and it does the same. Note that this requires instrumentation verification on (-Dco.paralleluniverse.fibers.verifyInstrumentation=true
)
The following code:
produces
There are two variants of
function
, one with no args, and one that accepts anAny
. The one with no args is never actually called, however note that in the stack trace it shows upat AKt.function() (A.kt:11) !! (instrumented suspendable calls at: lines [6], calls [AKt.function(java.lang.Object)])
.When this unused function is deleted verification succeeds as it should.
Digging a bit deeper, the overload of
function
triggers the more complex code path inExtendedStackTrace.java:getMethod()
. From what I understand this codepath tries to figure out which variant was called by using line number information in the bytecode. I think the bug is in this code, setting a breakpoint on thevisitEnd()
function in theMethodVisitor
revealsminLine = 6, maxLine = 26
, which is the merge of both function's min/max line number. This means the visitor states got mixed up somehow, causing that codepath to pick the wrong method.