Thread overview
[Issue 7201] New: Lambda template assignment to variable
Jan 03, 2012
Kenji Hara
January 02, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7201

           Summary: Lambda template assignment to variable
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-01-02 09:54:34 PST ---
In DMD 2.058head the compiler accepts a function template as argument for the
foo() function:

void foo(int function(int x) g) {}
void main() {
    foo((x) => 0); // OK
}


So I think it should accept an assignment too:

void main() {
    int function(int x) f;
    f = (x) => 0; // Error
}


Currently it gives:
test.d(3): Error: __lambda4 has no value

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7201


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-01-02 16:54:53 PST ---
I've already post a pull to support inference on AssignExp. https://github.com/D-Programming-Language/dmd/pull/593

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 03, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7201


bearophile_hugs@eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


--- Comment #2 from bearophile_hugs@eml.cc 2012-01-03 11:22:38 PST ---
Fixed, among other problems:

https://github.com/D-Programming-Language/dmd/commit/7fc5ebaf8776429fcaf38d1a55b6b25159ea9f18

See also bug 7176

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