| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/general/issue54553.dart:8:7: Error: Can't implement 'A?' because it's nullable. |
| // Try removing the question mark. |
| // class B implements A? {} // Error. |
| // ^ |
| // |
| // pkg/front_end/testcases/general/issue54553.dart:10:49: Error: Can't use a typedef denoting a type variable as a constructor, nor for a static member access. |
| // extension type EIAliasNullable(A? _) implements F<A?> {} // Error. |
| // ^ |
| // pkg/front_end/testcases/general/issue54553.dart:9:11: Context: This is the type variable ultimately denoted. |
| // typedef F<T> = T; |
| // ^ |
| // |
| // pkg/front_end/testcases/general/issue54553.dart:5:46: Error: Can't implement 'int?' because it's nullable. |
| // Try removing the question mark. |
| // extension type EINullable(int? _) implements int? {} // Error. |
| // ^ |
| // |
| // pkg/front_end/testcases/general/issue54553.dart:10:49: Error: The type 'F<A?>' which is an alias of 'A?' can't be implemented by an extension type because it is nullable. |
| // - 'A' is from 'pkg/front_end/testcases/general/issue54553.dart'. |
| // extension type EIAliasNullable(A? _) implements F<A?> {} // Error. |
| // ^ |
| // pkg/front_end/testcases/general/issue54553.dart:9:9: Context: The issue arises via this type alias. |
| // typedef F<T> = T; |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| typedef F<T extends core::Object? = dynamic> = T%; |
| class A extends core::Object { |
| synthetic constructor •() → self::A |
| : super core::Object::•() |
| ; |
| } |
| class B extends core::Object implements self::A { |
| synthetic constructor •() → self::B |
| : super core::Object::•() |
| ; |
| } |
| extension type EINullable(core::int? _) { |
| abstract extension-type-member representation-field get _() → core::int?; |
| constructor • = self::EINullable|constructor#; |
| constructor tearoff • = self::EINullable|constructor#_#new#tearOff; |
| } |
| extension type EIAliasNullable(self::A? _) { |
| abstract extension-type-member representation-field get _() → self::A?; |
| constructor • = self::EIAliasNullable|constructor#; |
| constructor tearoff • = self::EIAliasNullable|constructor#_#new#tearOff; |
| } |
| static extension-type-member method EINullable|constructor#(core::int? _) → self::EINullable% /* erasure=core::int?, declared=! */ { |
| lowered final self::EINullable% /* erasure=core::int?, declared=! */ #this = _; |
| return #this; |
| } |
| static extension-type-member method EINullable|constructor#_#new#tearOff(core::int? _) → self::EINullable% /* erasure=core::int?, declared=! */ |
| return self::EINullable|constructor#(_); |
| static extension-type-member method EIAliasNullable|constructor#(self::A? _) → self::EIAliasNullable% /* erasure=self::A?, declared=! */ { |
| lowered final self::EIAliasNullable% /* erasure=self::A?, declared=! */ #this = _; |
| return #this; |
| } |
| static extension-type-member method EIAliasNullable|constructor#_#new#tearOff(self::A? _) → self::EIAliasNullable% /* erasure=self::A?, declared=! */ |
| return self::EIAliasNullable|constructor#(_); |