| library test /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_sync2.dart:18:7: Error: A value of type 'String' can't be returned from a function with return type 'Null'. |
| // 'hello'; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| static field dynamic h = null; |
| static method foo((core::Object) → core::int? f) → void {} |
| static method test() → dynamic { |
| (core::Object) → Null f = (core::Object x) → Null { |
| return null; |
| }; |
| core::String? y = f(42){(core::Object) → Null}; |
| f = (core::Object x) → Null => invalid-expression "pkg/front_end/testcases/inference/block_bodied_lambdas_infer_bottom_sync2.dart:18:7: Error: A value of type 'String' can't be returned from a function with return type 'Null'. |
| 'hello'; |
| ^" in "hello" as{TypeError,ForNonNullableByDefault} Null; |
| self::foo((core::Object x) → Null { |
| return null; |
| }); |
| self::foo((core::Object x) → Never { |
| throw "not implemented"; |
| }); |
| } |
| static method main() → dynamic {} |