D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3771 - warn or disallow method as property usage without @property attribute
Summary: warn or disallow method as property usage without @property attribute
Status: RESOLVED INVALID
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-05 06:20 UTC by Witold Baryluk
Modified: 2019-11-06 14:41 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Witold Baryluk 2010-02-05 06:20:03 UTC
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 Witold Baryluk 2010-02-05 06:23:04 UTC
Similary with array methods without brackets:

a.find = b;
auto c = a.toUpper;
Comment 2 Witold Baryluk 2012-02-03 01:31:54 UTC
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 Jonathan M Davis 2012-02-03 10:26:59 UTC
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.