Using a constant char array in a case statement gives error.
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
-
Reporter name: Alfred
Original Reporter info from Mantis: DonAlfredo @DonAlfredo
- Reporter name: Alfred
Description:
program case_error;
type
TDischargeType = (dtResistor, dtCurrent, dtPower, dtUnknown);
const
TDischargeTypeUnit: array[TDischargeType] of Char = ('R','I','P','X');
var
aChar:char;
begin
aChar:='R';
case aChar of
TDischargeTypeUnit[TDischargeType.dtResistor]: writeln('I am ok');
end;
end.
case_error.lpr(14,50) Error: Constant Expression expected
Additional information:
Could be related:
https://bugs.freepascal.org/view.php?id=34091
Mantis conversion info:
- Mantis ID: 38097