Am 11.04.2021 um 22:27 schrieb Ryan Joseph via fpc-devel:

On Apr 10, 2021, at 9:47 AM, Ryan Joseph <generic...@gmail.com> wrote:

Just checked and pass_typecheck is called before overloading but ado_IsVariant is simply never set 
for that array. In tarraydef.GetTypeName you can see that "array of const" is associated 
with many flags so maybe we need to make a new flag which means "non-uniform elements"? I 
could probably easily build that into pass_typecheck for array constructors.

...
          if (ado_isarrayofconst in arrayoptions) or
                 (ado_isConstructor in arrayoptions) then
           begin
             if (ado_isvariant in arrayoptions) or ((highrange=-1) and 
(lowrange=0)) then
               GetTypeName:='Array Of Const'
             else
               GetTypeName:='{Array Of Const/Constant Open} Array of 
'+elementdef.typename;
           end

Any word on what I should do about this? If those flags present are not 
sufficient I'll add another flag but if that's not acceptable I'll simply have 
to allow the user to specialize with these array types, even though they will 
fail later one when the function is selected during overloading. Once I know 
that I'll submit another patch including the other changes that were requested.
Looking at it, it could be that there is a bug in tarrayconstructornode.pass_typecheck that hasn't really surfaced yet... I'll have to look at that first, but I don't know when I'll have the time for that.

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to