Skip to content

Transformed type is not picked up with inference - Dart 2.0.0-dev.17 #31914

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

Closed
kevmoo opened this issue Jan 16, 2018 · 3 comments
Closed

Transformed type is not picked up with inference - Dart 2.0.0-dev.17 #31914

kevmoo opened this issue Jan 16, 2018 · 3 comments
Labels
legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@kevmoo
Copy link
Member

kevmoo commented Jan 16, 2018

See https://travis-ci.org/dart-lang/pub_server/jobs/329567888#L442
Perhaps related to #31884

with

analyzer:
  strong-mode:
    implicit-casts: false
foo() async {
  String value;
  var thing = new Stream<List<int>>.fromIterable(<List<int>>[
    <int>[5]
  ]);

  await for (var item in thing.transform(UTF8.decoder)) {
    /// `error: A value of type 'dynamic' can't be assigned to a variable of type 'String'. (invalid_assignment at [pub_server] example/example.dart:29)`
    value = item;
  }
}
@kevmoo kevmoo added type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) legacy-area-analyzer Use area-devexp instead. labels Jan 16, 2018
@kevmoo
Copy link
Member Author

kevmoo commented Jan 16, 2018

CC @lrhn

kevmoo added a commit to dart-archive/pub_server that referenced this issue Jan 16, 2018
kevmoo added a commit to dart-archive/pub_server that referenced this issue Jan 17, 2018
@lrhn
Copy link
Member

lrhn commented Jan 17, 2018

That error message is very suspicious. There are no values with type dynamic.
I'm guessing it means that an expression with type dynamic is not assignable to String.

It looks very related to 31884. The type of item should be inferred as String, but apparently it isn't.

@leafpetersen
Copy link
Member

I can reproduce in dev.17, but not in dev.18, assuming fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-area-analyzer Use area-devexp instead. type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Projects
None yet
Development

No branches or pull requests

3 participants