<div dir="ltr">I started adding {$<span class="gmail-il">modeswitch</span> 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 pascal rules.<div><br></div><div>To demonstrate, if I have MyUnit.pas that defines a string type helper with EndsWith() and an IntToStr() function then consider the following code:</div><div><br></div><div>program Test;</div><div><br></div><div>uses</div><div>  MyUnit, SysUtils;</div><div><br></div><div>begin</div><div>  'hello'.EndsWith('lo'); // invokes MyUnit.TStringHelper.EndsWith()</div><div>  IntToStr(12); // invokes SysUtils.IntToStr()</div><div>end.</div><div><br></div><div>But if I reverse the uses order:</div><div><br></div><div><div>program Test;</div><div><br></div><div>uses</div><div>  SysUtils, MyUnit;</div><div><br></div><div>begin</div><div>  'hello'.EndsWith('lo'); // invokes SysUtils.TStringHelper.EndsWith()</div><div>  IntToStr(12); // invokes MyUnit.IntToStr()</div><div>end.</div></div><div><br></div><div>What should happen is that both examples use the function from the last unit in the uses clause. Using the example above with "uses SysUtils, MyUnit;" the following should happen:</div><div><br></div><div><div>  'hello'.EndsWith('lo'); // invokes MyUnit.TStringHelper.EndsWith()</div><div>  IntToStr(12); // invokes MyUnit.IntToStr()</div><div><br></div><div>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 found, pascal will choose to identify the name as the one coming from the last matching unit in the uses clause. Multiple type helpers should follow this same rule.</div><div><br></div><div>Please discuss and if we all agree I will file this as a bug in mantis. Thanks.</div><div></div></div></div>