[Lazarus] array[0..n] of class of TSomething

Flávio Etrusco flavio.etrusco at gmail.com
Wed Jul 13 04:56:02 CEST 2011


On Tue, Jul 12, 2011 at 7:53 PM, Hans-Peter Diettrich
<DrDiettrich1 at aol.com> wrote:
> Sven Barth schrieb:
>>
>> On 12.07.2011 18:38, leledumbo wrote:
>>>
>>> Seems like codetools parser bug. Try writing it type by type:
>>>
>>> type
>>>   Tp2pMessageClass = class of Tp2pMessage;
>>>   Tp2pMessageClassArray = array [0 .. 1] of Tp2pMessageClass;
>>> const
>>>   MsgTypes: Tp2pMessageClassArray = (
>>>     ...
>>>   );
>>
>> Free Pascal supports "class of" in declarations while Delphi does not, but
>> it's a seldom used feature so the developers of the code tools might not
>> have noticed that problem at all :)
>
> IMO this "comfort" is a misfeature, that bloats the compiler and all other
> parsers. It has not been introduced in Delphi for good reason.
>
> DoDi
>

Err, why pollute the namespace with an identifier you'll only refer
once? It's hardly essential but surely not a "misfeature" either.

-Flávio




More information about the Lazarus mailing list