<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">On Sat, Apr 13, 2019 at 6:04 PM Sven Barth via fpc-devel <<a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Maybe we should mention that in the documentation...<br></blockquote><div><br></div><div>AFAIK it's never been possible to use FPC-style operator overloading in mode Delphi... is it supposed to be allowed?</div><div><br></div><div>For example:</div><div><br></div><div>unit Unit1;</div><div><br></div><div>{$mode delphi}</div><div><br></div><div>interface</div><div><br></div><div>uses</div><div> Classes, SysUtils;</div><div><br></div><div>type</div><div> TRec = record</div><div> end;</div><div><br></div><div>operator Implicit(constref ARec: TRec): String;</div><div><br></div><div>implementation</div><div><br></div><div>operator Implicit(constref ARec: TRec): String;</div><div>begin</div><div>end;</div><div><br></div><div>end.</div><div><br></div><div>That program gives: "unit1.pas(14,10) Fatal: Syntax error, "=" expected but "identifier IMPLICIT" found" </div><div><br></div><div>Why it is specifically expecting "=", I have no idea. In general though I don't recall ever having successfully used non-"class operator" operators in {$mode Delphi}.</div><div><br></div><div>WRT the docs, there's a lot of things they don't mention. They entirely ignored the fact that records and objects (not just classes) can be enumerators until a few days ago. </div><div><br></div><div>Of course, nobody's gonna know the docs have been updated for a long long time, because they only get built every couple of years or so at best... (Unless you do it yourself, which is not even *that* hard, but still way harder than it *should* be in a manner that is rather far removed from FPC's usual cross-platform nature for pretty dubious results: i.e. the docs are pretty much *just ok*, not super great or anything.)</div></div></div></div></div>