www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3015] New: Lookup of non-member not working

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

           Summary: Lookup of non-member not working
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: andrei metalanguage.com


This code doesn't compile:

struct R
{
    bool empty();
    ref int front();
    void popFront();
}

ref int popNext(ref R fwdRange)
{
    auto result = & fwdRange.front();
    fwdRange.popFront;
    return *result;
}

void main()
{
    R r;
    int x = r.popNext;
}

The code should work: popNext should be looked up in R's outer scope if not a
member.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 20 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3015


Gide Nwawudu <gide nwawudu.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |gide nwawudu.com




--- Comment #1 from Gide Nwawudu <gide nwawudu.com>  2009-05-21 10:00:14 PDT ---
Added keyword, error message is as follows.

C:> dmd test.d
test.d(18): Error: no property 'popNext' for type 'R'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 21 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3015


Georg Wrede <georg iki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |georg iki.fi




--- Comment #2 from Georg Wrede <georg iki.fi>  2009-05-21 17:39:39 PDT ---
Invisible first paramter? Not with a one-parameter function?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 21 2009