Hi Dart team!
This issue reproduces in Dart 2.4.1, as well as what's currently on Dartpad, which I would assume is the latest stable release (2.5.2)
We ran into a pretty vexing issue this week. We're getting this traceback:
Uncaught TypeError: Cannot read property 'name' of undefined
at Object._isSubtype (<anonymous>:674:33)
at Object.assertIsSubtype (<anonymous>:570:14)
at main (<anonymous>:959:9)
at dartMainRunner (<anonymous>:18:5)
at <anonymous>:1235:7
at <anonymous>:1221:7
at dartProgram (<anonymous>:1232:5)
at <anonymous>:1239:3
at replaceJavaScript (frame.html:34)
at messageHandler (frame.html:50)
From this: https://dartpad.dartlang.org/8bce996480f42e85a2522845d9b8af6d
What's very interesting is that calling combineNested with a _single_ cascaded invocation triggers the failure, but adding a _second_ cascaded invocation obviates the issue! Additionally, when the multiple cascaded invocations are present, the _single cascade magically works!_
As far as we can tell, the typing is entirely valid for that code. That also works in ddc + dart2js -O3, but not O2 or O1. I would assume that dartpad uses O1, is that correct?
Thanks @corwinsheahan-wf for the bug report and the small repro. I'll add you to @corwinsheahan-wf #38927 which seems to report the same issue.
Most helpful comment
Thanks @corwinsheahan-wf for the bug report and the small repro. I'll add you to @corwinsheahan-wf #38927 which seems to report the same issue.