Open hkaripineni opened 1 month ago
Generated bindings for C enum:
enum ENUM_NAME_T { VALUE_0(0), VALUE_1(1), VALUE_2(2), VALUE_3(3); final int value; const ENUM_NAME_T (this.value); static ENUM_NAME_T fromValue(int value) => switch (value) { 0 => VALUE_0, 1 => VALUE_1, 2 => VALUE_2, 3 => VALUE_3, _ => throw ArgumentError("Unknown value for ENUM_NAME_T : $value"), }; }
The switch expression is giving me these errors:
Expected an identifier, Expected to find ';', Expected a class member
Expected an identifier
Expected to find ';'
Expected a class member
The errors go away when I replace the expression with a statement
static ENUM_NAME_T fromValue(int value) { switch (value) { case 0: return VALUE_0; case 1: return VALUE_1; case 2: return VALUE_2; case 3: return VALUE_3; default: throw ArgumentError("Unknown value for ENUM_NAME_T: $value"); } }
@hkaripineni What version of Dart are you running on?
Generated bindings for C enum:
The switch expression is giving me these errors:
Expected an identifier
,Expected to find ';'
,Expected a class member
The errors go away when I replace the expression with a statement