Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Michael Van Canneyt
On Thu, 27 Feb 2014, luiz americo pereira camara wrote: TSimpleModel = class(TPersistent)   protected     class function GetResourceClient: IResourceClient; virtual;     class property ResourceClient: IResourceClient read GetResourceClient;   public   end; Trying to compile the above code i g

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Sven Barth
Am 27.02.2014 04:36, schrieb luiz americo pereira camara: TSimpleModel = class(TPersistent) protected class function GetResourceClient: IResourceClient; virtual; class property ResourceClient: IResourceClient read GetResourceClient; public end; Trying to compile the above code i ge

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: Changing the GetResourceClient method from virtual to static works Is this a bug or by design? As Michael said this is by design. If you want to use a non-static class procedure you must not use "class property", but only "property" (yes, that works). So what's the speci

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Michael Van Canneyt
On Thu, 27 Feb 2014, Hans-Peter Diettrich wrote: Sven Barth schrieb: Changing the GetResourceClient method from virtual to static works Is this a bug or by design? As Michael said this is by design. If you want to use a non-static class procedure you must not use "class property", but only

[fpc-devel] Trunk build failure: forgotten commit of pastree.pp?

2014-02-27 Thread Reinier Olislagers
Got this: Compiling .\fcl-passrc\src\pparser.pp pparser.pp(3509,55) Error: Identifier not found "TPasClassConstructor" pparser.pp(3510,54) Error: Identifier not found "TPasClassDestructor" Perhaps associated with: r26891 | michael | 2014-02-26 23:48:14 +0100 (Wed, 26 Feb 2014) | 1 line * Added cl

[fpc-devel] [SOLVED] Re: Trunk build failure: forgotten commit of pastree.pp?

2014-02-27 Thread Reinier Olislagers
On 27/02/2014 09:26, Reinier Olislagers wrote: > Got this: > Compiling .\fcl-passrc\src\pparser.pp > pparser.pp(3509,55) Error: Identifier not found "TPasClassConstructor" > pparser.pp(3510,54) Error: Identifier not found "TPasClassDestructor" > > Perhaps associated with: > r26891 | michael | 2014

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread luiz americo pereira camara
2014-02-27 5:25 GMT-03:00 Sven Barth : > Am 27.02.2014 04:36, schrieb luiz americo pereira camara: > > Is this a bug or by design? >> > As Michael said this is by design. If you want to use a non-static class > procedure you must not use "class property", but only "property" (yes, that > works).

[fpc-devel] documentation TComponentState

2014-02-27 Thread Mattias Gaertner
Hi, Some TComponentState flags need documentation. Here are some suggestions: csAncestor: The component has a design ancestor. For example a form TForm2 inherited from a form TForm1. TForm1 and all its components are copied to TForm2. TForm2 and all its inherited components have csAncestor. Only

Re: [fpc-devel] documentation TComponentState

2014-02-27 Thread Michael Van Canneyt
On Thu, 27 Feb 2014, Mattias Gaertner wrote: Hi, Some TComponentState flags need documentation. Here are some suggestions: csAncestor: The component has a design ancestor. For example a form TForm2 inherited from a form TForm1. TForm1 and all its components are copied to TForm2. TForm2 and a

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Hans-Peter Diettrich
Michael Van Canneyt schrieb: So what's the special use of a *class* property? If it exists for Delphi compatibility only, why then is it handled differently from "property"? The reason is explained in the upcoming docs. Namely: a static method cannot be overridden. Sure, but virtual method

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Michael Van Canneyt
On Thu, 27 Feb 2014, Hans-Peter Diettrich wrote: Michael Van Canneyt schrieb: So what's the special use of a *class* property? If it exists for Delphi compatibility only, why then is it handled differently from "property"? The reason is explained in the upcoming docs. Namely: a static met

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Jonas Maebe
On 27 Feb 2014, at 12:40, luiz americo pereira camara wrote: Removing class before property compiles. But if i try to access the property using TSimpleModel.ResourceClient gives the following error: Error: Only class methods, class properties and class variables can be referred with class refe

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread luiz americo pereira camara
2014-02-27 12:35 GMT-03:00 Jonas Maebe : > > On 27 Feb 2014, at 12:40, luiz americo pereira camara wrote: > > Technically there's some obstacle to allow such construct? >> > > Class properties should be accessible from within static class methods. Got it. Thanks Luiz _

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Sven Barth
Am 27.02.2014 15:35, schrieb Hans-Peter Diettrich: Also "self" is no more known inside class methods in XE. In D7 it was the class type instead of the instance pointer. Thus a too restrictive compiler, geared towards compatibilitiy with *new* Delphi versions, may break existing code. Source pl

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Hans-Peter Diettrich
Michael Van Canneyt schrieb: The reason is explained in the upcoming docs. Namely: a static method cannot be overridden. Sure, but virtual methods (including class methods) can be overridden. The class property is part of this particular class, and descendent classes should not be able to o

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Hans-Peter Diettrich
Sven Barth schrieb: Am 27.02.2014 15:35, schrieb Hans-Peter Diettrich: Also "self" is no more known inside class methods in XE. In D7 it was the class type instead of the instance pointer. Thus a too restrictive compiler, geared towards compatibilitiy with *new* Delphi versions, may break exis

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Error: Only class methods, class properties and class variables can be referred with class references You have to declare an instance and then call its property. You don't have to instantiate the instance if the property maps to a class method. Technically there's some

Re: [fpc-devel] Class property and virtual getter

2014-02-27 Thread Sven Barth
On 28.02.2014 02:18, Hans-Peter Diettrich wrote: Sven Barth schrieb: Am 27.02.2014 15:35, schrieb Hans-Peter Diettrich: Also "self" is no more known inside class methods in XE. In D7 it was the class type instead of the instance pointer. Thus a too restrictive compiler, geared towards compatibi