Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(694)

Unified Diff: pkg/analyzer/test/src/task/strong/inferred_type_test.dart

Issue 1405803003: Fix loop var inference when iterating on a type-param type. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added extra test Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
index 51d4a1d9dac41ab471dfe35f0c3bda44441a071f..125b356f01fea9f3fbc8e6ff0f63572ff2a16d54 100644
--- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
+++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart
@@ -386,6 +386,23 @@ void main() {
int bar = 42;
}
+ class Bar<T extends Iterable<String>> {
+ void foo(T t) {
+ for (var i in t) {
+ int x = /*severe:StaticTypeError*/i;
+ }
+ }
+ }
+
+ class Baz<T, E extends Iterable<T>, S extends E> {
+ void foo(S t) {
+ for (var i in t) {
+ int x = /*severe:StaticTypeError*/i;
+ T y = i;
+ }
+ }
+ }
+
test() {
var list = <Foo>[];
for (var x in list) {
« no previous file with comments | « pkg/analyzer/lib/src/generated/static_type_analyzer.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698