Files
sdk/pkg/front_end/testcases/inference/bug30620_d.dart
T
Paul Berry 7df0fb6c28 Add type propagation support for conditional expressions.
This required adding a few extra parser events to allow the type
propagator to update its state when the `?` and `:` are encountered
(similar to what was done for `if`).

Fixes #30620.

Change-Id: I0d3ede8056fd8bab01ead5b242d00803286c9373
Reviewed-on: https://dart-review.googlesource.com/13182
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2017-10-11 20:21:22 +00:00

14 lines
409 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.
/*@testedFeatures=inference*/
library test;
String foo(obj) => obj is String
? /*@promotedType=String*/ obj
. /*@target=String::toUpperCase*/ toUpperCase()
: null;
main() {}