Ifdef conditional define ignored

Hi,

this gives an error, but should’t (as it should be equivalent to the next (commented) line).

Type “PCallStruct” cannot be used as an argument type for public global method “DoCall”, because it is not public

namespace CallStub;

interface

{ $define extvis}

type
  TCallStruct={$ifdef extvis} public {$endif} record
  {$ifdef extvis}
  public
  {$endif}
  end;
  PCallStruct=^TCallStruct;

procedure DoCall(par:PCallStruct); {$ifdef extvis} public; {$endif} empty; // works not
//procedure DoCall(par:PCallStruct); empty; // works

implementation

end.

Logged as bugs://E27455.

reproduced.

notice the extra space between { and $

with an extra space, this is a comment, not defining extvis.

If we remove the extra space, then works as expected.

But why does it see the public here:

procedure DoCall(par:PCallStruct); {$ifdef extvis} public; {$endif} empty; // works not

so thats still a bug, just on the second {$IFDEF} instead of the first ;).

Oh yes, you are totally right, I missed this one

bugs://E27455 was closed as fixed.