<div dir="ltr"><div dir="ltr">On Tue, Jul 9, 2019 at 12:32 PM Ryan Joseph <<a href="mailto:genericptr@gmail.com">genericptr@gmail.com</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">
So do I need to open another bug report for for this out/var/constref stuff? We already have <a href="https://bugs.freepascal.org/view.php?id=28949" rel="noreferrer" target="_blank">https://bugs.freepascal.org/view.php?id=28949</a> but that’s just about the overloading bugs. <br>
<br>
I think it needs to be something like var/out should be be blocked in properties (unless VARPROPSETTER is on?) and constref should be allowed. Please confirm if that’s correct and I’ll make another bug report.<br></blockquote><div><br></div><div>Well, I just checked, and with "out" and "var" for a getter with an array property it actually doesn't compile if you pass a literal. Which is good as at least it behaves logically.</div><div><br></div><div>That said, I'm unsure why setters need a directive, but getters do not. (Even constref works fine, with no directives, currently, for getters.)</div><div><br></div><div>If anything, what would make the most sense is to just have a {$VARPROP} directive that enabled all of the "by reference" stuff for both getters *and* setters, while otherwise restricting them both to only "const", "constref", or "unprefixed" parameters.</div><div><br></div><div>{$VARPROPSETTER} presumably needs to also be left as-is for Delphi compatibility, but that's not really a big deal either way. </div></div></div>