Thread overview
[Issue 8397] New: parameter types are not checked when assigning a function literal
Jul 18, 2012
Nils
Jul 19, 2012
Kenji Hara
Jul 22, 2012
Walter Bright
July 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8397

           Summary: parameter types are not checked when assigning a
                    function literal
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: mailme+d@nilsb.dyndns.org


--- Comment #0 from Nils <mailme+d@nilsb.dyndns.org> 2012-07-17 17:51:08 PDT ---
This compiles since 2.059:
---
void function(int) f;
void main() {
    f = function(string x) {};
}
---

2.058 correctly complains:
Error: cannot implicitly convert expression (__funcliteral1) of type void
function(string x) pure nothrow @safe to void function(int)

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-07-19 10:27:47 PDT ---
https://github.com/D-Programming-Language/dmd/pull/1059

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



--- Comment #2 from github-bugzilla@puremagic.com 2012-07-22 13:09:50 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/085a4ebb6c518da3e6a61841de0d9a5e45b475cb
fix Issue 8397 - parameter types are not checked when assigning a function
literal

https://github.com/D-Programming-Language/dmd/commit/2659baa9c8b47ff68725843b52db84247398a86f Merge pull request #1059 from 9rnsr/fix8397

Issue 8397 - parameter types are not checked when assigning a function literal

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


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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