dart-sdk/tests/language_2/implicit_downcast_during_if_statement_test.dart
Paul Berry 245340dd7f Insert implicit downcasts for the conditions of if statements.
Change-Id: I788d50dc3d95bb4652ff122a993cd092d7262c31
Reviewed-on: https://dart-review.googlesource.com/23160
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-22 19:29:24 +00:00

15 lines
384 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 = true;
if (b) {} // No error
b = new Object();
Expect.throwsTypeError(() {
if (b) {}
});
}