| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override.dart:13:36: Error: The required named parameter 'i' in method 'A.test_default' is not required in overridden method 'B.test_default'. |
| // void test_default({required int? i}) {} |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override.dart:8:8: Context: This is the overridden method ('test_default'). |
| // void test_default({int? i}) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override.dart:14:39: Error: The required named parameter 'i' in method 'A.test_nondefault' is not required in overridden method 'B.test_nondefault'. |
| // void test_nondefault({required int? i}) {} |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override.dart:9:8: Context: This is the overridden method ('test_nondefault'). |
| // void test_nondefault({int? i = 1}) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override.dart:15:35: Error: The required named parameter 'i' in method 'A.test_legacy' is not required in overridden method 'C.test_legacy'. |
| // void test_legacy({required int? i}) {} |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override_lib.dart:8:8: Context: This is the overridden method ('test_legacy'). |
| // void test_legacy({int i}) {} |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "required_name_override_lib.dart" as req; |
| |
| import "org-dartlang-testcase:///required_name_override_lib.dart"; |
| |
| class B extends core::Object { |
| synthetic constructor •() → self::B |
| ; |
| method test_default({core::int? i}) → void |
| ; |
| method test_nondefault({core::int? i = 1}) → void |
| ; |
| } |
| class A extends self::B implements req::C { |
| synthetic constructor •() → self::A |
| ; |
| method test_default({required core::int? i}) → void |
| ; |
| method test_nondefault({required core::int? i}) → void |
| ; |
| method test_legacy({required core::int? i}) → void |
| ; |
| } |
| static method main() → dynamic |
| ; |
| |
| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override_lib.dart:5:1: Error: A library can't opt out of non-nullable by default, when in nnbd-strong mode. |
| // // @dart=2.5 |
| // ^^^^^^^^^^^^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/required_name_override_lib.dart:8:25: Error: Optional parameter 'i' should have a default value because its type 'int' doesn't allow null. |
| // void test_legacy({int i}) {} |
| // ^ |
| // |
| import self as req; |
| import "dart:core" as core; |
| |
| class C extends core::Object { |
| synthetic constructor •() → req::C |
| ; |
| method test_legacy({core::int i}) → void |
| ; |
| } |