| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:17:6: Error: The return type of the method 'SubInIn.nullableBad' is 'T?', which does not match the return type, 'int?', of the overridden method, 'SuperIn.nullableBad'. |
| // Change to a subtype of 'int?'. |
| // T? nullableBad<T>(T t) => null; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:10:8: Context: This is the overridden method ('nullableBad'). |
| // int? nullableBad<T>(T t) => 1; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:18:5: Error: The return type of the method 'SubInIn.nonNullableBad' is 'T', which does not match the return type, 'int', of the overridden method, 'SuperIn.nonNullableBad'. |
| // Change to a subtype of 'int'. |
| // T nonNullableBad<T>(T t) => t; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:11:7: Context: This is the overridden method ('nonNullableBad'). |
| // int nonNullableBad<T>(T t) => 2; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:22:11: Error: The return type of the method 'SubOutIn.nullableSame' is 'String?', which does not match the return type, 'String', of the overridden method, 'SuperOut.nullableSame'. |
| // Change to a subtype of 'String'. |
| // String? nullableSame() => "foo"; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:10:10: Context: This is the overridden method ('nullableSame'). |
| // String nullableSame() => "foo"; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:24:6: Error: The return type of the method 'SubOutIn.nullableBad' is 'T?', which does not match the return type, 'int', of the overridden method, 'SuperOut.nullableBad'. |
| // Change to a subtype of 'int'. |
| // T? nullableBad<T>(T t) => null; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:12:7: Context: This is the overridden method ('nullableBad'). |
| // int nullableBad<T>(T t) => 1; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:25:5: Error: The return type of the method 'SubOutIn.nonNullableBad' is 'T', which does not match the return type, 'int', of the overridden method, 'SuperOut.nonNullableBad'. |
| // Change to a subtype of 'int'. |
| // T nonNullableBad<T>(T t) => t; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:13:7: Context: This is the overridden method ('nonNullableBad'). |
| // int nonNullableBad<T>(T t) => 2; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| import "messages_with_types_opt_out.dart" as mes; |
| |
| import "org-dartlang-testcase:///messages_with_types_opt_out.dart"; |
| |
| class SuperIn extends core::Object { |
| synthetic constructor •() → self::SuperIn |
| ; |
| method nullableSame() → core::String? |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(self::SuperIn::nullableBad::T% t) → core::int? |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(self::SuperIn::nonNullableBad::T% t) → core::int |
| ; |
| } |
| class SubInIn extends self::SuperIn { |
| synthetic constructor •() → self::SubInIn |
| ; |
| method nullableSame() → core::String? |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(self::SubInIn::nullableBad::T% t) → self::SubInIn::nullableBad::T? |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(self::SubInIn::nonNullableBad::T% t) → self::SubInIn::nonNullableBad::T% |
| ; |
| } |
| class SubOutIn extends mes::SuperOut { |
| synthetic constructor •() → self::SubOutIn |
| ; |
| method nullableSame() → core::String? |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(self::SubOutIn::nullableBad::T% t) → self::SubOutIn::nullableBad::T? |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(self::SubOutIn::nonNullableBad::T% t) → self::SubOutIn::nonNullableBad::T% |
| ; |
| } |
| static field () →? core::int nullableVar; |
| static field core::double nonNullableVar; |
| static method testOptIn() → dynamic |
| ; |
| |
| library /*isNonNullableByDefault*/; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.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/messages_with_types_opt_out.dart:19:5: Error: The return type of the method 'SubOutOut.nullableBad' is 'T', which does not match the return type, 'int', of the overridden method, 'SuperOut.nullableBad'. |
| // Change to a subtype of 'int'. |
| // T nullableBad<T>(T t) => null; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:12:7: Context: This is the overridden method ('nullableBad'). |
| // int nullableBad<T>(T t) => 1; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:20:5: Error: The return type of the method 'SubOutOut.nonNullableBad' is 'T', which does not match the return type, 'int', of the overridden method, 'SuperOut.nonNullableBad'. |
| // Change to a subtype of 'int'. |
| // T nonNullableBad<T>(T t) => t; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:13:7: Context: This is the overridden method ('nonNullableBad'). |
| // int nonNullableBad<T>(T t) => 2; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:26:5: Error: The return type of the method 'SubInOut.nullableBad' is 'T', which does not match the return type, 'int?', of the overridden method, 'SuperIn.nullableBad'. |
| // Change to a subtype of 'int?'. |
| // T nullableBad<T>(T t) => null; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:10:8: Context: This is the overridden method ('nullableBad'). |
| // int? nullableBad<T>(T t) => 1; |
| // ^ |
| // |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_out.dart:27:5: Error: The return type of the method 'SubInOut.nonNullableBad' is 'T', which does not match the return type, 'int', of the overridden method, 'SuperIn.nonNullableBad'. |
| // Change to a subtype of 'int'. |
| // T nonNullableBad<T>(T t) => t; |
| // ^ |
| // pkg/front_end/testcases/nnbd_mixed/messages_with_types_opt_in.dart:11:7: Context: This is the overridden method ('nonNullableBad'). |
| // int nonNullableBad<T>(T t) => 2; |
| // ^ |
| // |
| import self as mes; |
| import "dart:core" as core; |
| import "messages_with_types_opt_in.dart" as self; |
| |
| import "org-dartlang-testcase:///messages_with_types_opt_in.dart"; |
| |
| class SuperOut extends core::Object { |
| synthetic constructor •() → mes::SuperOut |
| ; |
| method nullableSame() → core::String |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(mes::SuperOut::nullableBad::T% t) → core::int |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(mes::SuperOut::nonNullableBad::T% t) → core::int |
| ; |
| } |
| class SubOutOut extends mes::SuperOut { |
| synthetic constructor •() → mes::SubOutOut |
| ; |
| method nullableSame() → core::String |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(mes::SubOutOut::nullableBad::T% t) → mes::SubOutOut::nullableBad::T% |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(mes::SubOutOut::nonNullableBad::T% t) → mes::SubOutOut::nonNullableBad::T% |
| ; |
| } |
| class SubInOut extends self::SuperIn { |
| synthetic constructor •() → mes::SubInOut |
| ; |
| method nullableSame() → core::String |
| ; |
| method nonNullableSame() → core::String |
| ; |
| method nullableBad<T extends core::Object? = dynamic>(mes::SubInOut::nullableBad::T% t) → mes::SubInOut::nullableBad::T% |
| ; |
| method nonNullableBad<T extends core::Object? = dynamic>(mes::SubInOut::nonNullableBad::T% t) → mes::SubInOut::nonNullableBad::T% |
| ; |
| } |
| static field core::String legacyVar; |
| static method testOptOut() → dynamic |
| ; |