blob: 7128b7b9d66854ce7b66b6d593c623a199a2c3ca [file] [log] [blame]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/regress/invalid_this_reference_06.dart:6:3: Error: 'Foo' is already declared in this scope.
// Foo([foo = foo]) => 42;
// ^^^
// pkg/front_end/testcases/regress/invalid_this_reference_06.dart:5:19: Context: Previous declaration of 'Foo'.
// extension type Foo(int foo) {
// ^
//
// pkg/front_end/testcases/regress/invalid_this_reference_06.dart:6:14: Error: Not a constant expression.
// Foo([foo = foo]) => 42;
// ^^^
//
// pkg/front_end/testcases/regress/invalid_this_reference_06.dart:6:23: Error: Constructors can't have a return type.
// Try removing the return type.
// Foo([foo = foo]) => 42;
// ^
//
import self as self;
import "dart:core" as core;
extension type Foo(core::int foo) {
abstract extension-type-member representation-field get foo() core::int;
constructor = self::Foo|constructor#;
constructor tearoff = self::Foo|constructor#_#new#tearOff;
constructor tester1 = self::Foo|constructor#tester1;
constructor tearoff tester1 = self::Foo|constructor#_#tester1#tearOff;
constructor tester2 = self::Foo|constructor#tester2;
constructor tearoff tester2 = self::Foo|constructor#_#tester2#tearOff;
}
static extension-type-member method Foo|constructor#(core::int foo) → self::Foo% /* erasure=core::int, declared=! */ {
lowered final self::Foo% /* erasure=core::int, declared=! */ #this = foo;
return #this;
}
static extension-type-member synthetic method Foo|constructor#_#new#tearOff(core::int foo) → self::Foo% /* erasure=core::int, declared=! */
return self::Foo|constructor#(foo);
static extension-type-member method Foo|constructor#tester1(core::String s) → self::Foo% /* erasure=core::int, declared=! */ {
lowered final self::Foo% /* erasure=core::int, declared=! */ #this = s.{core::String::length}{core::int};
return #this;
}
static extension-type-member synthetic method Foo|constructor#_#tester1#tearOff(core::String s) → self::Foo% /* erasure=core::int, declared=! */
return self::Foo|constructor#tester1(s);
static extension-type-member method Foo|constructor#tester2(core::int foo) → self::Foo% /* erasure=core::int, declared=! */ {
lowered final self::Foo% /* erasure=core::int, declared=! */ #this = foo;
return #this;
}
static extension-type-member synthetic method Foo|constructor#_#tester2#tearOff(core::int foo) → self::Foo% /* erasure=core::int, declared=! */
return self::Foo|constructor#tester2(foo);