Bug 7307 – Not fully enforced properties syntax

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-01-17T16:58:20Z
Last change time
2018-05-14T12:47:24Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2012-01-17T16:58:20Z
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 by lovelydear — 2012-04-19T14:22:59Z
Why ?
Comment #2 by nick — 2018-05-14T12:47:24Z
*** This issue has been marked as a duplicate of issue 8162 ***