sdk
sdk copied to clipboard
Better `const_with_non_constant_argument` message when argument is closure
Repro:
enum MyEnum {
v(() {});
// ^ const_with_non_constant_argument
const MyEnum(Function f);
}
Message:
Arguments of a constant creation must be constant expressions.
Try making the argument a valid constant, or use 'new' to call the constructor.
We should probably suggest creating a static method, a const constructor or a top-level function.
CC @bwilkerson