| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:5:6: Error: This requires the 'non-nullable' experiment to be enabled. |
| // Try enabling this experiment by adding it to the command line when compiling and running. |
| // int? field; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:6:6: Error: This requires the 'non-nullable' experiment to be enabled. |
| // Try enabling this experiment by adding it to the command line when compiling and running. |
| // int? bar(int? x); |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:6:15: Error: This requires the 'non-nullable' experiment to be enabled. |
| // Try enabling this experiment by adding it to the command line when compiling and running. |
| // int? bar(int? x); |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:17:54: Error: This requires the 'non-nullable' experiment to be enabled. |
| // Try enabling this experiment by adding it to the command line when compiling and running. |
| // int test_nullable_function_type_formal_param({int f()? : null}) { |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:4:7: Error: The non-abstract class 'Foo' is missing implementations for these members: |
| // - Foo.bar |
| // Try to either |
| // - provide an implementation, |
| // - inherit an implementation from a superclass or mixin, |
| // - mark the class as abstract, or |
| // - provide a 'noSuchMethod' implementation. |
| // |
| // class Foo { |
| // ^^^ |
| // pkg/front_end/testcases/nnbd/nullable_param.dart:6:8: Context: 'Foo.bar' is defined here. |
| // int? bar(int? x); |
| // ^^^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class Foo extends core::Object { |
| field core::int field = null; |
| synthetic constructor •() → self::Foo |
| : super core::Object::•() |
| ; |
| abstract method bar(core::int x) → core::int; |
| } |
| static method main() → dynamic { |
| self::Foo foo = new self::Foo::•(); |
| foo.{self::Foo::field} = 5; |
| foo.{self::Foo::bar}(6); |
| self::test_nullable_function_type_formal_param(f: () → core::int => 2); |
| } |
| static method test_nullable_function_type_formal_param({() → core::int f = null}) → core::int { |
| return let final core::int #t1 = f.call() in #t1.==(null) ?{core::int} 1.{core::int::unary-}() : #t1; |
| } |