Ryan Joseph via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am So., 28. Nov. 2021, 03:12:
> > > > On Nov 27, 2021, at 5:00 PM, Sven Barth <pascaldra...@googlemail.com> > wrote: > > > > The compiler does not know which routine is called upon parsing the > parameter declarations (which would mean that error reports would need to > be deferred until the lookup of the routine failed). > > My idea was to not actually have it affect overloading except in the case > where the param names don't match which would ignore the call (so in your > example below nothing changes). > > Otherwise if the name was actually part of the overloading we would have > to allow functions with the same parameter type but different names, i.e.: > > procedure Foo(Arg1: String = ''); > procedure Foo(Arg2: String = ''); > > and that would be a big change to the language and have all sorts of > implications. > > So it's really just a minor hint to make the call more readable in the > case of long function names. > Anything that relates to picking functions *must* be part of the overload handling. You can easily see this with your named argument proposal when not all arguments are named (and then the compiler also needs to check that unnamed parameters aren't used for named ones as well, this gets more complicated if the overloads have different argument names). You should have already learned this lesson when I pointed you in the right direction for the implicit function specializations. Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal