blob: 43c9271c5d5c21d052987c055a397a95f6637dd9 [file] [log] [blame]
// Copyright (c) 2020, 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";
Future<String> f() async {
throw 'f';
}
Future<String> g() async {
try {
// Should obtain the `Future<String>`, await it, then throw.
return f();
} catch (e) {
// Having caught the exception, we return a value.
return 'g';
}
}
void main() async {
Expect.equals('g', await g());
}