blob: baa2e584be7657a68fc874aa9d86b205fa6c1b54 [file] [log] [blame]
//
// Problems in component:
//
// pkg/front_end/testcases/general/magic_const.dart:15:39: Error: Can't have a non-constant List literal within a const context.
// foo({a: Constant(), b: Constant(), c: []}) {}
// ^
// pkg/front_end/testcases/general/magic_const.dart:15:36: Context: While analyzing:
// foo({a: Constant(), b: Constant(), c: []}) {}
// ^
//
library;
//
// Problems in library:
//
// pkg/front_end/testcases/general/magic_const.dart:18:9: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
// Try using a constructor or factory that is 'const'.
// const NotConstant();
// ^^^^^^^^^^^
//
import self as self;
import "dart:core" as core;
class Constant extends core::Object {
const constructor •() self::Constant*
: super core::Object::•()
;
}
class NotConstant extends core::Object {
synthetic constructor •() self::NotConstant*
: super core::Object::•()
;
}
static method foo({dynamic a = #C1, dynamic b = #C1, dynamic c = invalid-expression "Can't have a non-constant List literal within a const context."}) → dynamic {}
static method test() dynamic {
invalid-expression "pkg/front_end/testcases/general/magic_const.dart:18:9: Error: Cannot invoke a non-'const' constructor where a const expression is expected.
Try using a constructor or factory that is 'const'.
const NotConstant();
^^^^^^^^^^^";
new self::Constant::•();
core::bool::fromEnvironment("fisk");
}
static method main() dynamic {}
constants {
#C1 = self::Constant {}
}