Concatenated string const = illegal expression
Original Reporter info from Mantis: dezlov
-
Reporter name: Denis Kozlov
Original Reporter info from Mantis: dezlov
- Reporter name: Denis Kozlov
Description:
Compiler fails to compile concatenated string constants with an error message "Error: Illegal expression".
In the following example, compiler fails on "D", yet it accepts "C".
---------------------------
program Project1;
{$mode objfpc}{$H+}
const
A = '123';
B: string = '123';
C = '123' + A;
D = '123' + B;
begin
WriteLn(A, B, C, D);
end.
---------------------------
Also, the same happens if "B" is typed as Char, AnsiChar, AnsiString.
Mantis conversion info:
- Mantis ID: 20823
- OS: Windows
- OS Build: XP SP3
- Platform: Win32
- Version: 2.4.4
- Monitored by: » dezlov (Denis Kozlov)