Comment #0 by bearophile_hugs — 2013-11-13T03:02:58Z
Problem found by Gary Willoughby:
void main() {
int[string] aa;
aa.rehash;
}
dmd 2.065alpha gives (compiling with "-property"):
temp.d(3): Error: not a property aa.rehash
Comment #1 by bearophile_hugs — 2013-11-13T03:25:57Z
The same happens with ".dup".
Comment #2 by k.hara.pg — 2013-11-13T05:02:42Z
Currently this is not a bug.
In object.di, AssociativeArray template struct defines 'rehash' and 'dup' method as normal function. So under -property switch, you cannot call them without parenthesis.
Comment #3 by bearophile_hugs — 2013-11-13T06:19:07Z
(In reply to comment #2)
> Currently this is not a bug.
>
> In object.di, AssociativeArray template struct defines 'rehash' and 'dup'
> method as normal function. So under -property switch, you cannot call them
> without parenthesis.
Thank you. I think AA.dup should become a @property, for uniformity with array dup.
And perhaps rehash too. So now it's a low priority enhancement request.
Comment #4 by dkorpel — 2021-09-08T10:44:39Z
-property was deprecated in 2.069.2 and removed in 2.082.1, the example compiles today.