[fpc-devel] Problem with nested classes and const struct values

Flávio Etrusco flavio.etrusco at gmail.com
Tue May 1 06:23:49 CEST 2012


FWIW FPC 2.6.0 also triggers the same error. AFAICS this problem is
somewhat analogous to the limitation when declaring members in a
record. Are you sure the unit in your big project is being compiled?

-Flávio

On Mon, Apr 30, 2012 at 3:39 PM, Andrew Brunner
<andrew.t.brunner at gmail.com> wrote:
> Well,
>
> The problem started when I did a fresh install of Ubuntu 12.04.
> The main project that uses similar code to my attached test had FPC raise
> the same error but with similar code.
> Presently, a fresh build of FPC and Lazarus allows me to build my big
> project however, the test project still won't build with
>
> Compiling ./Test.lpr
> Test.lpr(65,36) Error: Incompatible types: got "Pointer" expected "PCLSInfo"
> Test.lpr(65,44) Error: Illegal expression
> Test.lpr(66,36) Error: Incompatible types: got "Pointer" expected "PACLInfo"
> Test.lpr(66,44) Error: Illegal expression
> Test.lpr(73) Fatal: There were 4 errors compiling module, stopping
> Fatal: Compilation aborted
>
> But yet my big project with very complex nested declarations compiles just
> fine
> <snip>
> unit coAdmin;
>
> interface
>   uses hTimer,hHTTP,hHTTPd,hRSR,uRSR,Classes,uCoreObjects,uKeywords,
>     hSRConsts,uTimer,uStringArray,uVarString,uKPList,hDateUtils,uFileUtils,
>
> dbmDomains,dbmCoreObjects,dbmUserAccounts,dbmRSS,dbmCalendaring,hDatabase;
>
> Type
>   ns=class
>   Type
>     Admin=class
>     const
>       XMLInf:TXMLInfo=(
>         Enabled                  : false;
>       );
>       ACLInf:TACLInfo=(
>         Name                     : 'Admin';
>         NameSpace                : '/core/admin';
>         Caption                  : 'Administration Core Object';
>         Prompt                   : 'User can access administration
> dashboard';
>         Description              : 'Back-end system administration handler'
>       );
>       CLSInf:TCLSInfo=(
>         Name                     : 'TAdminCore';
>         Location                 : 'coAdmin.pas';
>       );
>       Header:TCoreObjectInfo=(
>         ID                       : 0;
>         ProviderID               : 0;
>         Enabled                  : true;
>         Anonymous                : false;
>         NotifyOnBuffersChanged   : false;
>         Scale                    : 0;
>         CLSInfo                  : @CLSInf;
>         ACLInfo                  : @ACLInf;
>       );
>     <snip of more of these types of declarations>
>
>
> On Mon, Apr 30, 2012 at 1:12 PM, Jonas Maebe <jonas.maebe at elis.ugent.be>
> wrote:
>>
>>
>> On 30 Apr 2012, at 16:48, Andrew Brunner wrote:
>>
>> > This problem did not exist a few days ago.
>>
>> Can you be more precise? I just checked with trunk from before the
>> jvmbackend merge (which is from Thursday), and that one also gives an error.
>>
>>
>> Jonas_______________________________________________
>> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
>> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>
>
>
> _______________________________________________
> fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> http://lists.freepascal.org/mailman/listinfo/fpc-devel
>



More information about the fpc-devel mailing list