| library; |
| // |
| // Problems in library: |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:6:3: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // const C0() {} |
| // ^^^^^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:45:3: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // const E0(this.v) {} |
| // ^^^^^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:10:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:15:15: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this: x = x {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:19:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:24:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:30:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:34:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:38:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:45:9: Error: Generative enum constructors must be marked as 'const'. |
| // const E0(this.v) {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:50:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:56:8: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:62:15: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // this: v = v {} |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:42:3: Error: Cannot invoke a non-'const' constructor where a const expression is expected. |
| // Try using a constructor or factory that is 'const'. |
| // e0(0); |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:49:3: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // e0(0); |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:54:6: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // e0.someName(0); |
| // ^ |
| // |
| // pkg/front_end/testcases/primary_constructors/const_class.dart:60:3: Error: A const constructor can't have a body. |
| // Try removing either the 'const' keyword or the body. |
| // e0(0); |
| // ^ |
| // |
| import self as self; |
| import "dart:core" as core; |
| |
| class C0 extends core::Object { |
| constructor •() → self::C0 |
| : super core::Object::•() {} |
| } |
| class C1 extends core::Object /*hasConstConstructor*/ { |
| const constructor •() → self::C1 |
| : super core::Object::•() {} |
| } |
| class C2 extends core::Object /*hasConstConstructor*/ { |
| final field core::int x; |
| const constructor •(final core::int x) → self::C2 |
| : self::C2::x = x, super core::Object::•() {} |
| } |
| class C3 extends core::Object /*hasConstConstructor*/ { |
| final field core::int x; |
| const constructor •(final core::int x) → self::C3 |
| : self::C3::x = x, super core::Object::•() {} |
| } |
| class C4 extends core::Object /*hasConstConstructor*/ { |
| final field core::int x; |
| const constructor •(final core::int x) → self::C4 |
| : self::C4::x = x, super core::Object::•() {} |
| } |
| class A extends core::Object /*hasConstConstructor*/ { |
| final field core::int x; |
| const constructor •(final core::int x) → self::A |
| : self::A::x = x, super core::Object::•() |
| ; |
| } |
| class C5 extends self::A /*hasConstConstructor*/ { |
| const constructor •(final core::int x) → self::C5 |
| : super self::A::•(x) {} |
| } |
| class E0 extends core::_Enum /*isEnum*/ { |
| enum-element static const field invalid-type e0 = invalid-expression "pkg/front_end/testcases/primary_constructors/const_class.dart:42:3: Error: Cannot invoke a non-'const' constructor where a const expression is expected. |
| Try using a constructor or factory that is 'const'. |
| e0(0); |
| ^"; |
| final field core::int v; |
| static const field core::List<self::E0> values = invalid-expression "pkg/front_end/testcases/primary_constructors/const_class.dart:42:3: Error: Cannot invoke a non-'const' constructor where a const expression is expected. |
| Try using a constructor or factory that is 'const'. |
| e0(0); |
| ^"; |
| constructor •(core::int #index, core::String #name, core::int v) → self::E0 |
| : self::E0::v = v, super core::_Enum::•(#index, #name) {} |
| method core::_enumToString() → core::String |
| return "E0.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| class E1 extends core::_Enum /*isEnum*/ { |
| final field core::int v; |
| enum-element static const field self::E1 e0 = invalid-expression "A const constructor can't have a body."; |
| static const field core::List<self::E1> values = invalid-expression "A const constructor can't have a body."; |
| const constructor •(core::int #index, core::String #name, final core::int v) → self::E1 |
| : self::E1::v = v, super core::_Enum::•(#index, #name) {} |
| method core::_enumToString() → core::String |
| return "E1.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| class E2 extends core::_Enum /*isEnum*/ { |
| enum-element static const field self::E2 e0 = invalid-expression "A const constructor can't have a body."; |
| final field core::int v; |
| static const field core::List<self::E2> values = invalid-expression "A const constructor can't have a body."; |
| const constructor someName(core::int #index, core::String #name, final core::int v) → self::E2 |
| : self::E2::v = v, super core::_Enum::•(#index, #name) {} |
| method core::_enumToString() → core::String |
| return "E2.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| class E3 extends core::_Enum /*isEnum*/ { |
| enum-element static const field self::E3 e0 = invalid-expression "A const constructor can't have a body."; |
| final field core::int v; |
| static const field core::List<self::E3> values = invalid-expression "A const constructor can't have a body."; |
| const constructor •(core::int #index, core::String #name, final core::int v) → self::E3 |
| : self::E3::v = v, super core::_Enum::•(#index, #name) {} |
| method core::_enumToString() → core::String |
| return "E3.${this.{core::_Enum::_name}{core::String}}"; |
| } |
| extension type ET1(core::int v) { |
| abstract extension-type-member representation-field get v() → core::int; |
| constructor • = self::ET1|constructor#; |
| constructor tearoff • = self::ET1|constructor#_#new#tearOff; |
| } |
| extension type ET2(core::int v) { |
| abstract extension-type-member representation-field get v() → core::int; |
| constructor someName = self::ET2|constructor#someName; |
| constructor tearoff someName = self::ET2|constructor#_#someName#tearOff; |
| } |
| static extension-type-member const method ET1|constructor#(core::int v) → self::ET1% /* erasure=core::int, declared=! */ {} |
| static extension-type-member synthetic method ET1|constructor#_#new#tearOff(core::int v) → self::ET1% /* erasure=core::int, declared=! */ |
| return self::ET1|constructor#(v); |
| static extension-type-member const method ET2|constructor#someName(core::int v) → self::ET2% /* erasure=core::int, declared=! */ {} |
| static extension-type-member synthetic method ET2|constructor#_#someName#tearOff(core::int v) → self::ET2% /* erasure=core::int, declared=! */ |
| return self::ET2|constructor#someName(v); |