blob: 05857360fc5efe7ee6105978a82446455cfce22d [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();
// ^^^^^
//
import self as self;
import "dart:core" as core;
class Class extends core::Object /*hasConstConstructor*/ {
constructor •() self::Class
;
const constructor named() self::Class
: super core::Object::•()
;
}
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 = const self::Class::named();
static method main() dynamic
;
Extra constant evaluation status:
Evaluated: ConstructorInvocation @ org-dartlang-testcase:///non_const_constructor.dart:14:17 -> InstanceConstant(const Class{})
Extra constant evaluation: evaluated: 1, effectively constant: 1