www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11509] New: AA.rehash doesn't compile with -property

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11509

           Summary: AA.rehash doesn't compile with -property
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs eml.cc 2013-11-13 03:02:58 PST ---
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

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 13 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11509



--- Comment #1 from bearophile_hugs eml.cc 2013-11-13 03:25:57 PST ---
The same happens with ".dup".

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 13 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11509



--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-11-13 05:02:42 PST ---
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.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 13 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11509


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|rejects-valid               |
            Summary|AA.rehash doesn't compile   |AA.dup  property
                   |with -property              |
           Severity|normal                      |enhancement


--- Comment #3 from bearophile_hugs eml.cc 2013-11-13 06:19:07 PST ---
(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. -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 13 2013