5c51990a80
Closes #43174 Change-Id: I6b1cc04cbf2d65d9b877dfabf3e0f535f2491a94 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168542 Reviewed-by: Dmitry Stefantsov <dmitryas@google.com> Commit-Queue: Johnni Winther <johnniwinther@google.com>
25 lines
433 B
Dart
25 lines
433 B
Dart
// 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 'dart:async';
|
|
|
|
method(void Function() f) {
|
|
f();
|
|
}
|
|
|
|
method2(FutureOr<void> Function() f) {
|
|
f();
|
|
}
|
|
|
|
test() {
|
|
method(() {
|
|
return 42; // error
|
|
});
|
|
method2(() {
|
|
return 42; // ok
|
|
});
|
|
}
|
|
|
|
main() {}
|