Thread overview
[Issue 3771] New: warn or disallow method as property usage without @property attribute
Feb 05, 2010
Witold Baryluk
Feb 05, 2010
Witold Baryluk
Feb 03, 2012
Witold Baryluk
Feb 03, 2012
Jonathan M Davis
February 05, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3771

           Summary: warn or disallow method as property usage without
                    @property attribute
           Product: D
           Version: 2.040
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: baryluk@smp.if.uj.edu.pl


--- Comment #0 from Witold Baryluk <baryluk@smp.if.uj.edu.pl> 2010-02-05 06:20:03 PST ---
We have now @property and in feature we will have other attributes.

It is time to not only have this syntax, but actually do something with this
information:
 - emit warning when using method without call brackets on getter/setter
 - emit warning when using array methods: a.find(b) == find(a, b)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 05, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=3771



--- Comment #1 from Witold Baryluk <baryluk@smp.if.uj.edu.pl> 2010-02-05 06:23:04 PST ---
Similary with array methods without brackets:

a.find = b;
auto c = a.toUpper;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3771



--- Comment #2 from Witold Baryluk <baryluk@smp.if.uj.edu.pl> 2012-02-03 01:31:54 PST ---
I belive this bug is almost fixed in compiler in repository. Is Phobos updated accordingly to use @property property in array / string functions?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
February 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=3771


Jonathan M Davis <jmdavisProg@gmx.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jmdavisProg@gmx.com


--- Comment #3 from Jonathan M Davis <jmdavisProg@gmx.com> 2012-02-03 10:26:59 PST ---
What updating would there need to be? If it has @property, you use it as a property. If it doesn't you don't. Some of the functions are @property, some aren't. You can still use the member function call syntax for arrays regardless.

If you want @property enforcement to be enabled, then compile with -property. It'll be phased into the normal behavior later.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------