Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Ryan Joseph via fpc-pascal
> On Mar 10, 2020, at 8:09 PM, Anthony Walter wrote: > > An issue has been submitted here > https://bugs.freepascal.org/view.php?id=36783 under the FPC compiler with > tags "type helpers". Can you make up an example that doesn't use SysUtils? Here's something I made up really quick but I

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
Marco, now that's some good insight. I believe you are correct. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Marco van de Voort
Op 2020-03-10 om 14:46 schreef Anthony Walter via fpc-pascal: Stdreamer, you are wrong. The last unit take precedence. Please test to verify. Yes. He might be mixed up with the uses clause of the main program governing unit initialization. ___

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
Stdreamer, you are wrong. The last unit take precedence. Please test to verify. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread stdreamer via fpc-pascal
On 10/3/2020 10:22 π.μ., Mattias Gaertner via fpc-pascal wrote: On Tue, 10 Mar 2020 00:57:12 -0400 Anthony Walter via fpc-pascal wrote: [...] What should happen is that both examples use the function from the last unit in the uses clause. Yes, that's how Pascal usually works and so it works

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Anthony Walter via fpc-pascal
An issue has been submitted here https://bugs.freepascal.org/view.php?id=36783 under the FPC compiler with tags "type helpers". I just want to take a moment and thank you guys for your work and explain for a moment my STRONG support for multiple type helpers. Multiple type helpers have been a big

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Sven Barth via fpc-pascal
Michael Van Canneyt schrieb am Di., 10. März 2020, 08:11: > > > On Tue, 10 Mar 2020, Anthony Walter via fpc-pascal wrote: > > > I started adding {$modeswitch multihelpers} to some of my code and > noticed > > a problem. It would seem that the SysUtils unit is defining type helpers > > for the

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Sven Barth via fpc-pascal
Ryan Joseph via fpc-pascal schrieb am Di., 10. März 2020, 09:03: > > > > On Mar 10, 2020, at 11:57 AM, Anthony Walter via fpc-pascal < > fpc-pascal@lists.freepascal.org> wrote: > > > > To demonstrate, if I have MyUnit.pas that defines a string type helper > with EndsWith() and an IntToStr()

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 08:11:21 +0100 (CET) Michael Van Canneyt wrote: >[...] > I'm inclined to think you found the reason why Embarcadero disallows > type helpers. That would imply E thought type helpers through. I doubt that, e.g. write access to read only properties. > A type helper extends

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Mattias Gaertner via fpc-pascal
On Tue, 10 Mar 2020 00:57:12 -0400 Anthony Walter via fpc-pascal wrote: >[...] > What should happen is that both examples use the function from the > last unit in the uses clause. Yes, that's how Pascal usually works and so it works in pas2js. Strange that fpc does it the other way round. Bug

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Ryan Joseph via fpc-pascal wrote: On Mar 10, 2020, at 11:57 AM, Anthony Walter via fpc-pascal wrote: To demonstrate, if I have MyUnit.pas that defines a string type helper with EndsWith() and an IntToStr() function then consider the following code: program Test;

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Ryan Joseph via fpc-pascal
> On Mar 10, 2020, at 11:57 AM, Anthony Walter via fpc-pascal > wrote: > > To demonstrate, if I have MyUnit.pas that defines a string type helper with > EndsWith() and an IntToStr() function then consider the following code: > > program Test; > > uses > MyUnit, SysUtils; > > begin >

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Michael Van Canneyt wrote: I know some of you might see this as a small problem, but it's an inconstancy that can lead to a situation where the wrong methods will be called without being obvious. The standard has long been that when an identifier of the same name is is

Re: [fpc-pascal] modeswitch multihelpers precedence problem

2020-03-10 Thread Michael Van Canneyt
On Tue, 10 Mar 2020, Anthony Walter via fpc-pascal wrote: I started adding {$modeswitch multihelpers} to some of my code and noticed a problem. It would seem that the SysUtils unit is defining type helpers for the string type and this led me to discover that multiple type helpers takes

[fpc-pascal] modeswitch multihelpers precedence problem

2020-03-09 Thread Anthony Walter via fpc-pascal
I started adding {$modeswitch multihelpers} to some of my code and noticed a problem. It would seem that the SysUtils unit is defining type helpers for the string type and this led me to discover that multiple type helpers takes precedence over other helpers in a way that is conflicts with other