Files
sdk/tests/language_2/implicit_downcast_during_conditional_expression_test.dart
T
Paul Berry e28d041d45 Add a language_2 test of implicit downcasts in conditional expressions
Change-Id: I2f346ce2ee1cc8b6d6b61d63750b2ae909fdf456
Reviewed-on: https://dart-review.googlesource.com/22602
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-11-21 18:45:28 +00:00

15 lines
386 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;
b ? 1 : 2; // No error
b = new Object();
Expect.throwsTypeError(() {
b ? 1 : 2;
});
}