b75502513a
This CL fixes type inference of closures using '=>' syntax so that
they infer consistently with an equivalent closure defined using block
syntax ('{}').
Fixes #31436.
Change-Id: I5463dd0ba986e9953ebabbc24ce3ced9a7220007
Reviewed-on: https://dart-review.googlesource.com/27084
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
15 lines
415 B
Dart
15 lines
415 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;
|
|
|
|
f() {
|
|
List<int> o;
|
|
o. /*@target=Iterable::forEach*/ forEach(
|
|
/*@returnType=void*/ (/*@type=int*/ i) => i /*@target=num::+*/ + 1);
|
|
}
|
|
|
|
main() {}
|