<div dir="auto"><div class="gmail_quote" dir="auto"><div dir="ltr">Am Fr., 9. Nov. 2018, 05:48 hat Ryan Joseph <<a href="mailto:ryan@thealchemistguild.com">ryan@thealchemistguild.com</a>> geschrieben:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I’m getting a parse error here. It thinks the “U” is another type but in fact it’s another generic parameter and not related to “T” at all. Is this a bug? I don’t think the way the parsing works the compiler actually can discern this condition.<br>
<br>
{$mode objfpc}<br>
{$modeswitch advancedrecords}<br>
<br>
program generic_constants_restricted;<br>
<br>
type<br>
generic TList<T:tobject, U> = record<br>
end;<br>
<br>
begin<br>
end.<br></blockquote></div><div dir="auto"><br></div><div dir="auto">You must use ";" in that case. All parameters separated by "," are of the same "constraint type" while ";" separates these. Essentially like a parameter declaration for a function. </div><div dir="auto">(and yes, Delphi handles it like that as well) </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>