Thread overview
[Issue 8225] New: UFCS when the first argument is a function
Dec 27, 2012
Andrej Mitrovic
Dec 27, 2012
Andrej Mitrovic
June 11, 2012
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


--- Comment #0 from bearophile_hugs@eml.cc 2012-06-11 13:36:07 PDT ---
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: -------
December 27, 2012
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


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-26 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: -------
December 27, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8225



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2012-12-26 17:56:47 PST ---
(In reply to comment #1)
> 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: -------