blob: 1711f58ded66b448ad4dec9788db83877238e3cb [file] [log] [blame]
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
// ^^
//
// 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
// ^
//
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;
abstract extension-type-member representation-field get x2() 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
^" in invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: Not a constant expression.
@x2
^^"
abstract extension-type-member representation-field get a() 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
^" in invalid-expression "pkg/front_end/testcases/regress/invalid_this_reference_01.dart:8:4: Error: Not a constant expression.
@x2
^^"
abstract extension-type-member representation-field get b() core::int?;
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 method Foo|constructor#_#new#tearOff(core::String x) → self::Foo% /* erasure=core::String, declared=! */
return self::Foo|constructor#(x);