| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/regress/invalid_this_reference_01.dart:6:7: Error: Extension types can't declare instance fields |
| // Try removing the field declaration or making it a static field |
| // int x2 = 42; |
| // ^^ |
| // |
| // pkg/front_end/testcases/regress/invalid_this_reference_01.dart:9:8: Error: Extension types can't declare instance fields |
| // Try removing the field declaration or making it a static field |
| // int? a, b; |
| // ^ |
| // |
| // pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: Not a constant expression. |
| // @x2 |
| // ^^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| extension type Foo(core::String x) { |
| abstract extension-type-member representation-field get x() → core::String; |
| get x2 = self::Foo|get#x2; |
| set x2 = self::Foo|set#x2; |
| get a = self::Foo|get#a; |
| set a = self::Foo|set#a; |
| get b = self::Foo|get#b; |
| set b = self::Foo|set#b; |
| constructor • = self::Foo|constructor#; |
| constructor tearoff • = self::Foo|constructor#_#new#tearOff; |
| } |
| static extension-type-member method Foo|constructor#(core::String x) → self::Foo% /* erasure=core::String, declared=! */ { |
| lowered final self::Foo% /* erasure=core::String, declared=! */ #this = x; |
| return #this; |
| } |
| static extension-type-member synthetic method Foo|constructor#_#new#tearOff(core::String x) → self::Foo% /* erasure=core::String, declared=! */ |
| return self::Foo|constructor#(x); |
| static abstract extension-type-member method Foo|get#x2(lowered core::String #this) → core::int; |
| static abstract extension-type-member method Foo|set#x2(lowered core::String #this, synthesized core::int #externalFieldValue) → void; |
| @invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor. |
| @x2 |
| ^" |
| static abstract extension-type-member method Foo|get#a(lowered core::String #this) → core::int?; |
| @invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor. |
| @x2 |
| ^" |
| static abstract extension-type-member method Foo|set#a(lowered core::String #this, synthesized core::int? #externalFieldValue) → void; |
| @invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor. |
| @x2 |
| ^" |
| static abstract extension-type-member method Foo|get#b(lowered core::String #this) → core::int?; |
| @invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: This can't be used as an annotation; an annotation should be a reference to a compile-time constant variable, or a call to a constant constructor. |
| @x2 |
| ^" |
| static abstract extension-type-member method Foo|set#b(lowered core::String #this, synthesized core::int? #externalFieldValue) → void; |