mirror of
https://github.com/dart-lang/sdk
synced 2024-11-05 18:22:09 +00:00
33ee69b3e4
The test change of '.nooooo()' -> '.field' mitigates a bunch of status file changes that would be required. Since this is an await, and not a strong mode/ ddc/ resolution test, this test was modified in this way. Change-Id: I54bb9ff51c2e86dd61eb41fdfc19c93bbdf22f7a Reviewed-on: https://dart-review.googlesource.com/4142 Commit-Queue: Jaime Wren <jwren@google.com> Reviewed-by: Janice Collins <jcollins@google.com>
23 lines
524 B
Dart
23 lines
524 B
Dart
// Copyright (c) 2015, 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.
|
|
|
|
// Regression test for issue dartbug.com/24392
|
|
|
|
import 'package:expect/expect.dart';
|
|
import 'dart:async';
|
|
|
|
Future<int> f() async {
|
|
// Unreachable.
|
|
Expect.isTrue(false);
|
|
}
|
|
|
|
main() async {
|
|
int x = 1;
|
|
x ??= await f();
|
|
Expect.equals(1, x);
|
|
|
|
int y = 1;
|
|
y = y ?? await f();
|
|
Expect.equals(1, y);
|
|
}
|