Chromium Code Reviews| Index: pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| diff --git a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| index 85a1085bef0fc6b253a86b6854b5c9315a60e496..f63285281e4ceb9e4a561b26a20c01de046f0d7d 100644 |
| --- a/pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| +++ b/pkg/analyzer/test/src/task/strong/inferred_type_test.dart |
| @@ -1919,4 +1919,29 @@ test2() { |
| } |
| '''); |
| }); |
| + |
| + |
| + test('block bodied lambdas', () { |
| + // Regression test for https://github.com/dart-lang/sdk/issues/25487 |
| + checkFile(r''' |
| +import 'dart:math' show Random; |
| +test1() { |
| + List<int> o; |
| + var y = o.map(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) { return x + 1; }); |
| + Iterable<int> z = y; |
| +} |
| +test2() { |
| + List<num> o; |
| + var y = o.map(/*info:INFERRED_TYPE_CLOSURE,info:INFERRED_TYPE_CLOSURE*/(x) { |
| + if (new Random().nextBool()) { |
| + return x.toInt() + 1; |
| + } else { |
| + return x.toDouble(); |
| + } |
| + }); |
| + Iterable<num> w = y; |
| + Iterable<int> z = /*info:ASSIGNMENT_CAST*/y; |
| +} |
|
Leaf
2016/02/23 02:17:47
I'd like to be sure we cover this pretty well. Ca
Jennifer Messerly
2016/02/23 17:41:46
Excellent list. Yeah I can do that.
Jennifer Messerly
2016/02/24 00:20:41
Done.
|
| + '''); |
| + }); |
| } |