blob: 06ba28bd25bd85e6a68ff9ca222074ddf4724ad7 [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
/*@testedFeatures=inference,error*/
library test;
import 'dart:async';
T f<T>() => null;
class A {}
class B extends A {}
test() async {
Iterable<A> iterable;
Stream<A> stream;
A a;
B b;
int i;
for (a in iterable) {}
await for (a in stream) {}
for (b in iterable) {}
await for (b in stream) {}
for (i /*@error=InvalidAssignment*/ in iterable) {}
await for (i /*@error=InvalidAssignment*/ in stream) {}
for (a in /*@typeArgs=Iterable<A>*/ f()) {}
await for (a in /*@typeArgs=Stream<A>*/ f()) {}
}
main() {}