Open smaifullerton-wk opened 5 years ago
First of all, I have to thank you, so so much, on a stellar bug report. 👏 👏 👏 Thank you for the craftsmanship in the minimal reproduction, for the thoughtful embedded debug statements, and for the note about dart2js vs DDC. I can't guess at how long you've been trying to figure this problem out, in order to ultimately come up with this detailed report.
I've been able to reproduce this bug exactly (DDC is happy, dart2js is not). I'll look into it; seems like it may be a dart2js bug...
I believe this is a dart2js bug. I've filed https://github.com/dart-lang/sdk/issues/37322.
@srawlins any update on when this might be looked at? the dart2js issue has no movement on it as of yet
No fix on dart2js yet, but we just found a cause and workaround at https://github.com/dart-lang/sdk/issues/37322#issuecomment-540898984.
Here is a simplified test case of a bug I'm seeing with the
thenAnswer
Invocation when this code is compiled with dart2js. With DDC, it works as expected:There are no issues if the callback payload is a primitive.
It appears that
Invocation
with a callback argument works correctly on its own with this simplified case:Thank you for taking a look.