03.01.2019 6:32, Ryan Joseph пишет:


On Jan 2, 2019, at 8:25 PM, Alexander Shishkin via fpc-pascal 
<fpc-pascal@lists.freepascal.org> wrote:

This is not consistent with constraints. Should be ";" after T.

And what about following examples?


The semicolon is only needed following a generic parameter which is 
constrained. This was the normal behavior before constants were introduced.

generic TMyRecord1<T: TObject; const U: integer> = record


It is not exactly true, semicolon separates parameter lists different restrictions including empty one.

This should fail to compile (": integer" restriction can not be applied to non const parameter):
generic TMyRecord1<T, const U: integer> = record end;
generic TMyRecord1<const T, U: integer> = record end;

This is OK (T is any type):
generic TMyRecord1<T; const U: integer> = record end;

This is OK (both T and U are integer):
generic TMyRecord1<const T, const U: integer> = record end;

This is OK (T is any const,  U and V are integer)
generic TMyRecord1<const T; const U, const V: integer> = record end;

--AVS

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to