www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2883] New: array member call syntax fails when array is returned from "property" syntax

reply d-bugmail puremagic.com writes:

           Summary: array member call syntax fails when array is returned
                    from "property" syntax
           Product: D
           Version: 1.041
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: cbkbbejeap mailinator.com

When you want to use the "myArray.myFuncTakingAnArray()" syntax on an array
that's returned from a function, it fails to compile if the array-returning
function is called using "getArray" instead of "getArray()".

char[] getArray()
{ return "hello"; }

void useArray(char[] str)
{ /* stuff */ }

void main()
        int i;
        i = getArray().length; // Ok
        i = getArray.length;   // Ok

        getArray().useArray(); // Ok
        getArray.useArray();   // Error: no property 'useArray' for type

Apr 22 2009
parent d-bugmail puremagic.com writes:

Jonathan M Davis <jmdavisProg gmail.com> changed:

           What    |Removed                     |Added
                 CC|                            |jmdavisProg gmail.com

--- Comment #1 from Jonathan M Davis <jmdavisProg gmail.com> 2010-03-07
18:39:46 PST ---
This is true in D2 as well. With dmd 2.040, this problem still exists.

Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 07 2010