[fpc-pascal] Generic constants with generic type

Andrey Zubarev zamtmn at gmail.com
Wed Apr 21 17:59:45 CEST 2021


Ok. Thanks!
For this already there is a bug report? to notice when it will work?

On Wed, Apr 21, 2021 at 2:12 PM Sven Barth via fpc-pascal <
fpc-pascal at lists.freepascal.org> wrote:

> Andrey Zubarev via fpc-pascal <fpc-pascal at lists.freepascal.org> schrieb
> am Mi., 21. Apr. 2021, 09:23:
>
>> Hi all!
>> With the existing syntax of constants, it is good to pass array
>> boundaries, but bad to initial parameter values. What do you think about
>> such constructs:
>>
>> GTValue<GValueType; const GMin,GDefault,GMax:GValueType>=...
>>
>
> It is currently simply not possible to reference earlier type parameters
> inside the parameter clause. This affects code like this as well: generic
> TSomeGeneric<T; S: ISomeOtherGeneric<T>>
> Once that is fixed your case will probably work as well as long as the
> type is one for which untyped constants can be declared.
>
> Regards,
> Sven
>
>> _______________________________________________
> fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
> https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20210421/27058bcb/attachment.htm>


More information about the fpc-pascal mailing list