blob: 8c5c7232c00599cc51e6cc1dd9628f78bde2d39c [file]
library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/constants/non_const_constructor.dart:8:3: Error: A const constructor can't have a body.
// Try removing either the 'const' keyword or the body.
// const Class.named() {
// ^^^^^
//
// pkg/front_end/testcases/general/constants/non_const_constructor.dart:13:17: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
// Try using a constructor or factory that is 'const'.
// const a = const Class();
// ^^^^^
//
// pkg/front_end/testcases/general/constants/non_const_constructor.dart:14:17: Error: A const constructor can't have a body.
// Try removing either the 'const' keyword or the body.
// const b = const Class.named();
// ^
//
import self as self;
import "dart:core" as core;
class Class extends core::Object /*hasConstConstructor*/ {
constructor •() self::Class
: super core::Object::•()
;
const constructor named() self::Class
: super core::Object::•() {
1;
}
}
static const field invalid-type a = invalid-expression "pkg/front_end/testcases/general/constants/non_const_constructor.dart:13:17: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
Try using a constructor or factory that is 'const'.
const a = const Class();
^^^^^";
static const field self::Class b = invalid-expression "A const constructor can't have a body.";
static method main() dynamic {}