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: Correct inference of Future.value type, without a context type #53371

Open
srawlins opened this issue Aug 29, 2023 · 0 comments
Open

CFE: Correct inference of Future.value type, without a context type #53371

srawlins opened this issue Aug 29, 2023 · 0 comments
Assignees
Labels
area-front-end Use area-front-end for front end / CFE / kernel format related issues.

Comments

@srawlins
Copy link
Member

Implementation issue for CFE for dart-lang/language#3304.

See this code:

Object? f(int? x) { return Future.value(x)..foo; }

void main() {
  print(f(null));
}

CFE infers the type of Future.value(...) to be a Future<int?>("Error: The getter 'foo' isn't defined for the class 'Future<int?>'."). Analyzer infers it to be Future<int>. In dart-lang/language#3304, it was decided that CFE infers the wrong type here.

This discrepancy is blocking #53253.

@srawlins srawlins added the area-front-end Use area-front-end for front end / CFE / kernel format related issues. label Aug 29, 2023
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.
Projects
None yet
Development

No branches or pull requests

2 participants