[fpc-devel] Implicit function specialization precedence

Ryan Joseph genericptr at gmail.com
Sat Apr 10 17:47:11 CEST 2021



> On Apr 10, 2021, at 9:18 AM, Ryan Joseph <genericptr at gmail.com> wrote:
> 
> I checked before and here's what I got. Maybe pass_typecheck hasn't been called yet? If not I'll have to reproduce that code and determine how it knows the elements are not uniform. Thanks.

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


Regards,
	Ryan Joseph



More information about the fpc-devel mailing list