Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2022-05

const specialize = 1;

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Martin Frb

is it allowed to use the identifier "specialize" as constant (or type or var)?

Because it compiles with 3.3.1. (the line that defines the constant).

But it seems it can't be used.
At least it fails in the below scenario, when trying to use as value.

program foo;
{$mode objfpc}{$H+}
const specialize = 1; // compiles
var a: integer;
begin
   if a = specialize then // error // comment out for fail on next line
     a:=specialize; // error
end;

Reply by email