www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 9490] New: 'this' is not found when array expression is in parentheses

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

           Summary: 'this' is not found when array expression is in
                    parentheses
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-02-09
10:31:51 PST ---
class C
{
    int[] arr;

    this()
    {
        // ok
        assert(arr.length);

        // Error: need 'this' to access member arr
        assert((arr).length);
    }
}

void main()
{
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=9490


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |yebblies gmail.com
         AssignedTo|nobody puremagic.com        |yebblies gmail.com


--- Comment #1 from yebblies <yebblies gmail.com> 2013-06-29 13:16:31 EST ---
arr goes the IdentifierExp -> DsymbolExp -> DotVarExp path, while (arr) seems
to go the TypeExp -> VarExp -> Error path.

Producing DsymbolExp when resolving TypeExp to a variable does the trick, but
breaks other code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 28 2013