Bug 8397 – parameter types are not checked when assigning a function literal

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-17T17:51:00Z
Last change time
2012-07-22T13:47:43Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
nilsbossung

Comments

Comment #0 by nilsbossung — 2012-07-17T17:51:08Z
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)
Comment #1 by k.hara.pg — 2012-07-19T10:27:47Z
Comment #2 by github-bugzilla — 2012-07-22T13:09:50Z
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