D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7307 - Not fully enforced properties syntax
Summary: Not fully enforced properties syntax
Status: RESOLVED DUPLICATE of issue 8162
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2012-01-17 16:58 UTC by bearophile_hugs
Modified: 2018-05-14 12:47 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 bearophile_hugs 2012-01-17 16:58:20 UTC
Currently (DMD 2.058head) this code compiles with no errors if you compile it with -property -w:


@property size_t len(T)(in T[] a) {
    return a.length;
}
void main() {
    int[10] a;
    assert(a.len() == 10);
}


But I think the -property has to statically refuse code that uses () on properties.
Comment 1 SomeDude 2012-04-19 14:22:59 UTC
Why ?
Comment 2 Nick Treleaven 2018-05-14 12:47:24 UTC

*** This issue has been marked as a duplicate of issue 8162 ***