Index: pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart |
diff --git a/pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart b/pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..852fb3fd716c2b84e6e45fdd97deef4c17f51301 |
--- /dev/null |
+++ b/pkg/front_end/testcases/inference/block_bodied_lambdas_returns.dart |
@@ -0,0 +1,82 @@ |
+// 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; |
+ |
+main() { |
+ var /*@type=() -> Null*/ a = /*@returnType=Null*/ () {}; |
+ var /*@type=() -> Null*/ b = /*@returnType=Null*/ () { |
+ return; |
+ }; |
+ var /*@type=() -> Null*/ c = /*@returnType=Null*/ () { |
+ return null; |
+ }; |
+ var /*@type=() -> int*/ d = /*@returnType=int*/ () { |
+ return 0; |
+ }; |
+ var /*@type=(bool) -> Null*/ e = /*@returnType=Null*/ (bool b) { |
+ if (b) { |
+ return; |
+ } else { |
+ return; |
+ } |
+ }; |
+ var /*@type=(bool) -> Null*/ f = /*@returnType=Null*/ (bool b) { |
+ if (b) { |
+ return; |
+ } else { |
+ return null; |
+ } |
+ }; |
+ var /*@type=(bool) -> int*/ g = /*@returnType=int*/ (bool b) { |
+ if (b) { |
+ return; |
+ } else { |
+ return 0; |
+ } |
+ }; |
+ var /*@type=(bool) -> Null*/ h = /*@returnType=Null*/ (bool b) { |
+ if (b) { |
+ return null; |
+ } else { |
+ return; |
+ } |
+ }; |
+ var /*@type=(bool) -> Null*/ i = /*@returnType=Null*/ (bool b) { |
+ if (b) { |
+ return null; |
+ } else { |
+ return null; |
+ } |
+ }; |
+ var /*@type=(bool) -> int*/ j = /*@returnType=int*/ (bool b) { |
+ if (b) { |
+ return null; |
+ } else { |
+ return 0; |
+ } |
+ }; |
+ var /*@type=(bool) -> int*/ k = /*@returnType=int*/ (bool b) { |
+ if (b) { |
+ return 0; |
+ } else { |
+ return; |
+ } |
+ }; |
+ var /*@type=(bool) -> int*/ l = /*@returnType=int*/ (bool b) { |
+ if (b) { |
+ return 0; |
+ } else { |
+ return null; |
+ } |
+ }; |
+ var /*@type=(bool) -> int*/ m = /*@returnType=int*/ (bool b) { |
+ if (b) { |
+ return 0; |
+ } else { |
+ return 0; |
+ } |
+ }; |
+} |