dart-sdk/tests/language_2/implicit_downcast_during_for_initializer_var_test.dart
Paul Berry 5ce5811216 Insert implicit downcasts for the conditions of for statements.
Change-Id: I213617cb4ea1a5c29f8a6a56f54792c59cc4e132
Reviewed-on: https://dart-review.googlesource.com/23221
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-23 16:47:32 +00:00

15 lines
423 B
Dart

// 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.
import "package:expect/expect.dart";
void main() {
Object b = 0;
for (int i = b; i < 1; i++) {} // No error
b = new Object();
Expect.throwsTypeError(() {
for (int i = b; i < 1; i++) {}
});
}