| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/extension_types/issue53170.dart:5:38: Error: The implemented interface 'String' must be a supertype of the representation type 'num' of extension type 'S1'. |
| // Try changing the interface type to a supertype of 'num' or the representation type to a subtype of 'String'. |
| // extension type S1(num id) implements String /* Error */ {} |
| // ^ |
| // |
| // pkg/front_end/testcases/extension_types/issue53170.dart:11:41: Error: The representation type 'String' of extension type 'V2' must be either a subtype of the representation type 'num' of the implemented extension type 'V1' or a subtype of 'V1' itself. |
| // Try changing the representation type to a subtype of 'num'. |
| // extension type V2(String id) implements V1 /* Error */ {} |
| // ^ |
| // |
| // pkg/front_end/testcases/extension_types/issue53170.dart:17:41: Error: The representation type 'String' of extension type 'W2' must be either a subtype of the representation type 'num' of the implemented extension type 'W1<num>' or a subtype of 'W1<num>' itself. |
| // Try changing the representation type to a subtype of 'num'. |
| // extension type W2(String id) implements W1<num> /* Error */ {} |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| extension type S1(core::num id) implements core::String { |
| abstract extension-type-member representation-field get id() → core::num; |
| constructor • = self::S1|constructor#; |
| constructor tearoff • = self::S1|constructor#_#new#tearOff; |
| } |
| extension type S2(core::int id) implements core::num { |
| abstract extension-type-member representation-field get id() → core::int; |
| constructor • = self::S2|constructor#; |
| constructor tearoff • = self::S2|constructor#_#new#tearOff; |
| } |
| extension type V1(core::num id) { |
| abstract extension-type-member representation-field get id() → core::num; |
| constructor • = self::V1|constructor#; |
| constructor tearoff • = self::V1|constructor#_#new#tearOff; |
| } |
| extension type V2(core::String id) implements self::V1% /* erasure=core::num, declared=! */ { |
| abstract extension-type-member representation-field get id() → core::String; |
| constructor • = self::V2|constructor#; |
| constructor tearoff • = self::V2|constructor#_#new#tearOff; |
| } |
| extension type V3(core::int id) implements self::V1% /* erasure=core::num, declared=! */ { |
| abstract extension-type-member representation-field get id() → core::int; |
| constructor • = self::V3|constructor#; |
| constructor tearoff • = self::V3|constructor#_#new#tearOff; |
| } |
| extension type W1<T extends core::Object? = dynamic>(T% id) { |
| abstract extension-type-member representation-field get id() → T%; |
| constructor • = self::W1|constructor#; |
| constructor tearoff • = self::W1|constructor#_#new#tearOff; |
| } |
| extension type W2(core::String id) implements self::W1<core::num>% /* erasure=core::num, declared=! */ { |
| abstract extension-type-member representation-field get id() → core::String; |
| constructor • = self::W2|constructor#; |
| constructor tearoff • = self::W2|constructor#_#new#tearOff; |
| } |
| extension type W3(core::int id) implements self::W1<core::num>% /* erasure=core::num, declared=! */ { |
| abstract extension-type-member representation-field get id() → core::int; |
| constructor • = self::W3|constructor#; |
| constructor tearoff • = self::W3|constructor#_#new#tearOff; |
| } |
| static extension-type-member method S1|constructor#(core::num id) → self::S1 /* erasure=core::num */ { |
| lowered final self::S1 /* erasure=core::num */ #this = id; |
| return #this; |
| } |
| static extension-type-member method S1|constructor#_#new#tearOff(core::num id) → self::S1 /* erasure=core::num */ |
| return self::S1|constructor#(id); |
| static extension-type-member method S2|constructor#(core::int id) → self::S2 /* erasure=core::int */ { |
| lowered final self::S2 /* erasure=core::int */ #this = id; |
| return #this; |
| } |
| static extension-type-member method S2|constructor#_#new#tearOff(core::int id) → self::S2 /* erasure=core::int */ |
| return self::S2|constructor#(id); |
| static extension-type-member method V1|constructor#(core::num id) → self::V1% /* erasure=core::num, declared=! */ { |
| lowered final self::V1% /* erasure=core::num, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V1|constructor#_#new#tearOff(core::num id) → self::V1% /* erasure=core::num, declared=! */ |
| return self::V1|constructor#(id); |
| static extension-type-member method V2|constructor#(core::String id) → self::V2% /* erasure=core::String, declared=! */ { |
| lowered final self::V2% /* erasure=core::String, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V2|constructor#_#new#tearOff(core::String id) → self::V2% /* erasure=core::String, declared=! */ |
| return self::V2|constructor#(id); |
| static extension-type-member method V3|constructor#(core::int id) → self::V3% /* erasure=core::int, declared=! */ { |
| lowered final self::V3% /* erasure=core::int, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method V3|constructor#_#new#tearOff(core::int id) → self::V3% /* erasure=core::int, declared=! */ |
| return self::V3|constructor#(id); |
| static extension-type-member method W1|constructor#<T extends core::Object? = dynamic>(self::W1|constructor#::T% id) → self::W1<self::W1|constructor#::T%>% /* erasure=self::W1|constructor#::T%, declared=! */ { |
| lowered final self::W1<self::W1|constructor#::T%>% /* erasure=self::W1|constructor#::T%, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method W1|constructor#_#new#tearOff<T extends core::Object? = dynamic>(self::W1|constructor#_#new#tearOff::T% id) → self::W1<self::W1|constructor#_#new#tearOff::T%>% /* erasure=self::W1|constructor#_#new#tearOff::T%, declared=! */ |
| return self::W1|constructor#<self::W1|constructor#_#new#tearOff::T%>(id); |
| static extension-type-member method W2|constructor#(core::String id) → self::W2% /* erasure=core::String, declared=! */ { |
| lowered final self::W2% /* erasure=core::String, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method W2|constructor#_#new#tearOff(core::String id) → self::W2% /* erasure=core::String, declared=! */ |
| return self::W2|constructor#(id); |
| static extension-type-member method W3|constructor#(core::int id) → self::W3% /* erasure=core::int, declared=! */ { |
| lowered final self::W3% /* erasure=core::int, declared=! */ #this = id; |
| return #this; |
| } |
| static extension-type-member method W3|constructor#_#new#tearOff(core::int id) → self::W3% /* erasure=core::int, declared=! */ |
| return self::W3|constructor#(id); |