| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/extension_types/issue52849.dart:7:37: Error: The representation type 'num' of extension type 'V' must be either a subtype of the representation type 'String' of the implemented extension type 'V1' or a subtype of 'V1' itself. |
| // Try changing the representation type to a subtype of 'String'. |
| // extension type V(num id) implements V1 /* Error */ {} |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| extension type V1(core::String id) { |
| abstract extension-type-member representation-field get id() → core::String; |
| constructor • = self::V1|constructor#; |
| constructor tearoff • = self::V1|constructor#_#new#tearOff; |
| } |
| extension type V(core::num id) implements self::V1% /* erasure=core::String, declared=! */ { |
| abstract extension-type-member representation-field get id() → core::num; |
| constructor • = self::V|constructor#; |
| constructor tearoff • = self::V|constructor#_#new#tearOff; |
| } |
| static extension-type-member method V1|constructor#(core::String id) → self::V1% /* erasure=core::String, declared=! */ { |
| lowered final self::V1% /* erasure=core::String, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V1|constructor#_#new#tearOff(core::String id) → self::V1% /* erasure=core::String, declared=! */ |
| return self::V1|constructor#(id); |
| static extension-type-member method V|constructor#(core::num id) → self::V% /* erasure=core::num, declared=! */ { |
| lowered final self::V% /* erasure=core::num, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V|constructor#_#new#tearOff(core::num id) → self::V% /* erasure=core::num, declared=! */ |
| return self::V|constructor#(id); |