D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5527 - Bug in http://www.digitalmars.com/d/2.0/ctod.html#closures ?
Summary: Bug in http://www.digitalmars.com/d/2.0/ctod.html#closures ?
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-05 03:04 UTC by Dr. Christian Maurer
Modified: 2015-06-09 05:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Dr. Christian Maurer 2011-02-05 03:04:43 UTC
Dear Community,

Applying "dmd" (version 2.051 for Linux) to a source file xxx.d with the content of the example "Dynamic Closures", with "followed by "void main () { ; }", I get the following error messages (where n = number of the line "c.apply (comp_max)" in it):

xxx.d(n): Error: function xxx.func.comp_max (int i) is not collable using argument types ()
xxx.d(n): Error: expected 1 function arguments, not 0
xxx.d(n): Error: function xxx.Collection.apply (void delegate(int) fp) is not collable using argument types (void)
xxx.d(n): Error: cannot implicitly convert (comp_max()) of type void to void delegate(int)

Anybody got an idea, of what could be wrong?

With kind regards,
Christian
Comment 1 Dr. Christian Maurer 2011-02-05 12:20:56 UTC
Dear Community,

forgot to explicitly remark, that my question was put with regard to the >first< example, not to the one with function literals (although from the context with the definition of the line number, that should be obvious).

Regards, Christian