Bug 3771 – warn or disallow method as property usage without @property attribute

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
Other
OS
Linux
Creation time
2010-02-05T06:20:03Z
Last change time
2019-11-06T14:41:18Z
Assigned to
No Owner
Creator
Witold Baryluk

Comments

Comment #0 by witold.baryluk+d — 2010-02-05T06:20:03Z
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)
Comment #1 by witold.baryluk+d — 2010-02-05T06:23:04Z
Similary with array methods without brackets: a.find = b; auto c = a.toUpper;
Comment #2 by witold.baryluk+d — 2012-02-03T01:31:54Z
I belive this bug is almost fixed in compiler in repository. Is Phobos updated accordingly to use @property property in array / string functions?
Comment #3 by issues.dlang — 2012-02-03T10:26:59Z
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.