c04215d5f6
Bug: http://dartbug.com/34899 Change-Id: Ia7d9c0c9be711e3f9f0e07552222f1b28a140ec1 Reviewed-on: https://dart-review.googlesource.com/c/81240 Reviewed-by: Peter von der Ahé <ahe@google.com> Commit-Queue: Dmitry Stefantsov <dmitryas@google.com>
30 lines
596 B
Dart
30 lines
596 B
Dart
// Copyright (c) 2018, 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.
|
|
|
|
class Foo<T> {
|
|
final Future<dynamic> Function() quux;
|
|
T t;
|
|
|
|
Foo(this.quux, this.t);
|
|
|
|
Future<T> call() => quux().then<T>((_) => t);
|
|
}
|
|
|
|
class Bar {
|
|
Foo<Baz> qux;
|
|
|
|
Future<void> quuz() =>
|
|
qux().then((baz) => corge(baz)).then((grault) => garply(grault));
|
|
|
|
Grault corge(Baz baz) => null;
|
|
|
|
void garply(Grault grault) {}
|
|
}
|
|
|
|
class Baz {}
|
|
|
|
class Grault {}
|
|
|
|
main() {}
|