| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/general/covariant_super_check.dart:16:27: Error: The parameter 'a' of the method 'C.method' has type 'String', which does not match the corresponding type, 'num', in the overridden method, 'A.method'. |
| // Change to a supertype of 'num', or, for a covariant parameter, a subtype. |
| // method(covariant String a) {} |
| // ^ |
| // pkg/front_end/testcases/general/covariant_super_check.dart:6:3: Context: This is the overridden method ('method'). |
| // method(num a) {} |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| method method(core::num a) → dynamic {} |
| } |
| class B extends self::A { |
| synthetic constructor •() → self::B |
| : super self::A::•() |
| ; |
| method method(dynamic a) → dynamic {} |
| } |
| class C extends self::B { |
| synthetic constructor •() → self::C |
| : super self::B::•() |
| ; |
| method method(covariant-by-declaration core::String a) → dynamic {} |
| } |
| static method main() → dynamic {} |