-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Wrong run-time type of the value returned by generator function #53051
Comments
This is the bug which was reported here, which gave rise to dart-lang/language#3218. With the old rules, Next, we get the Presumably you ran the experiment using So it's all working or failing as expected, considering the known issues. The second example can be explained along the same lines, but in this case there is no doubt: We get a |
I tested command-line To clarify. We have an known issue here the But if the fact, that variable declared as |
Yes, that's because they are running the VM, and the VM has a fix for #49396, but dart2js does not (and that's the reason why #50601 is still open, at least for a couple of days yet ;-). So the VM behavior is correct here, and the dart2js behavior is not. I think DDC has the fix as well. But none of the tools have a fix (yet) for the generator element type bug (that was a spec bug), which is the reason why we get a So we have one issue which is #49396, which is just about to be completely fixed. Next, we have one fault which is about the element type of a generator, and there is no github issue for that, yet (and the spec change just landed). I just created #53052 in order to address the updates needed now that the spec bug has been fixed. |
Ok, thak you for clarification. Closing this issue then |
Why run-time type of the variable from the below is
Future
?Ok, the fact that type of
it1
isList<dynamic>
instead ofList<int>
is a known issue described here. But why it isFuture
?Note that if to remove nullability issue connected with the
Future
disappersTested on
Dart SDK version: 3.1.0-333.0.dev (dev) (Thu Jul 20 13:04:10 2023 -0700) on "windows_x64"
cc @eernstg @lrhn
The text was updated successfully, but these errors were encountered: