[Issue 2883] New: array member call syntax fails when array is returned from "property" syntax

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 22 21:36:55 PDT 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2883

           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 at digitalmars.com
        ReportedBy: cbkbbejeap at 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
'char[]'
}
-------------


-- 



More information about the Digitalmars-d-bugs mailing list