www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8225] New: UFCS when the first argument is a function

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

           Summary: UFCS when the first argument is a function
           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



Is this supposed to be supported?


int apply(int function(int) f, int x) { return f(x); }
enum bar = (int x) => x;
void main() {
    assert(apply(bar, 10) == 10); // OK
    assert(bar.apply(5) == 5); // line 5, error
}


dmd 2.060alpha gives:

test.d(5): Error: no property 'apply' for type 'pure nothrow  safe int(int x)'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 11 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8225


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



16:06:50 PST ---
Fixed in 2.061

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 26 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8225




17:56:47 PST ---

 Fixed in 2.061
Actually also fixed in 2.060 release -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 26 2012