#1 2015-01-22 16:18:02

jgb
Member
From: Canada
Registered: 2014-11-07
Posts: 7

Delphi using commented compiler directives - really

I discovered this strange problem when I used attributes to on the TSQLRecord properties to override the JSON field names.

Consider:

...
published
  [TFieldAttribute('firstName')]
  property FIRST_NAME;
...

These attribute values where not getting picked up. After a lot of digging I came across this line in SynCommons.pas (line 13649):

    AllCount: Integer; // !!!! may need {$RTTI EXPLICIT FIELDS([vcPublic])}

if I change to:

    AllCount: Integer; // !!!! may need {$.RTTI EXPLICIT FIELDS([vcPublic])}

the problem goes away.

I cannot duplicate this every time, but when I update the mORMot source and build the symptom of this problem occurs and adding the period resolves the problem.

Which sort of makes sense, because according to the documentation they way that the RTTI directive is used there it would hide published... everything. What doesn't make sense is that it is commented out so I wonder if this is a bug in Delphi 2010.

Offline

#2 2015-01-22 17:41:56

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: Delphi using commented compiler directives - really

Do not worry: Delphi 2010 is just buggy...
Less than Delphi 2009, but...

I modified the source to avoid this:
http://synopse.info/fossil/info/bd45234f2b

Thanks for the report!

Offline

Board footer

Powered by FluxBB