Skip to content
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

[cfe] Adjust computation of flatten #47057

Closed
eernstg opened this issue Aug 31, 2021 · 6 comments
Closed

[cfe] Adjust computation of flatten #47057

eernstg opened this issue Aug 31, 2021 · 6 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@eernstg
Copy link
Member

eernstg commented Aug 31, 2021

This is the CFE specific issue for #47053, which has the details.

@eernstg eernstg added area-front-end Use area-front-end for front end / CFE / kernel format related issues. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) labels Aug 31, 2021
@johnniwinther johnniwinther added the P2 A bug or feature request we're likely to work on label Aug 31, 2021
@eernstg
Copy link
Member Author

eernstg commented Aug 31, 2021

@johnniwinther, am I right in guessing that you have been working on this?

@johnniwinther
Copy link
Member

Dima and I have been working various parts of it. As I understand it we have update our flatten computation, right? Is it a spec change or just an implementation bug?

@eernstg
Copy link
Member Author

eernstg commented Aug 31, 2021

We did not change the spec, but it looks like flatten(T & Future<int>) returns T or T & Future<int>, but it should return int.

(I just asked Dmitry about the fact that the type of x is reported as T rather than T & Future<int>, but assigning x to a variable of type Future<int> is allowed even though the type prints as T, so I assume that it must be represented as T & Future<int> internally.)

@johnniwinther
Copy link
Member

The runtimes only look at the T part of T & X.

@eernstg
Copy link
Member Author

eernstg commented Aug 31, 2021

(I'm always confused when a type named X isn't a type variable, and a type variable isn't named X, Y or something thereabouts. But I do know that T is a type variable in a lot of concrete cases. ;-)

The runtimes shouldn't need to worry about this, because it's concerned with a static error (and even in the case where the program is allowed to run, this type isn't reified).

@chloestefantsova
Copy link
Contributor

The issue is being worked on at https://dart-review.googlesource.com/c/sdk/+/212467.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues. P2 A bug or feature request we're likely to work on type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants