<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Am Do., 3. Jan. 2019, 12:58 hat Alexander Shishkin via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">03.01.2019 6:32, Ryan Joseph пишет:<br>
> <br>
> <br>
>> On Jan 2, 2019, at 8:25 PM, Alexander Shishkin via fpc-pascal <<a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank" rel="noreferrer">fpc-pascal@lists.freepascal.org</a>> wrote:<br>
>><br>
>> This is not consistent with constraints. Should be ";" after T.<br>
>><br>
>> And what about following examples?<br>
>><br>
> <br>
> The semicolon is only needed following a generic parameter which is constrained. This was the normal behavior before constants were introduced.<br>
> <br>
> generic TMyRecord1<T: TObject; const U: integer> = record<br>
><br>
<br>
It is not exactly true, semicolon separates parameter lists different <br>
restrictions including empty one.<br>
<br>
This should fail to compile (": integer" restriction can not be applied <br>
to non const parameter):<br>
generic TMyRecord1<T, const U: integer> = record end;<br>
generic TMyRecord1<const T, U: integer> = record end;<br>
<br>
This is OK (T is any type):<br>
generic TMyRecord1<T; const U: integer> = record end;<br>
<br>
This is OK (both T and U are integer):<br>
generic TMyRecord1<const T, const U: integer> = record end;<br>
<br>
This is OK (T is any const, U and V are integer)<br>
generic TMyRecord1<const T; const U, const V: integer> = record end;<br></blockquote></div><div dir="auto"><br></div><div dir="auto">Correct. ";" separates different parameter types, "," separates those of the same type. Though I agree with Mattias that "const T, const U" (with or without ": Integer") should not work (but then "T, const U" should also not work for consistency). </div><div dir="auto">Essentially it should behave like a routine's parameter clause. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div>