On Tue, Jul 9, 2019 at 12:32 PM Ryan Joseph <[email protected]> wrote:
> So do I need to open another bug report for for this out/var/constref > stuff? We already have https://bugs.freepascal.org/view.php?id=28949 but > that’s just about the overloading bugs. > > 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. > 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. That said, I'm unsure why setters need a directive, but getters do not. (Even constref works fine, with no directives, currently, for getters.) 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. {$VARPROPSETTER} presumably needs to also be left as-is for Delphi compatibility, but that's not really a big deal either way.
_______________________________________________ fpc-devel maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
