digitalmars.D.bugs - [Issue 15732] New: std.function partial does not work with function
- via Digitalmars-d-bugs (28/28) Feb 27 2016 https://issues.dlang.org/show_bug.cgi?id=15732
https://issues.dlang.org/show_bug.cgi?id=15732 Issue ID: 15732 Summary: std.function partial does not work with function / delegate references Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: enhancement Priority: P1 Component: phobos Assignee: nobody puremagic.com Reporter: abc.mikey googlemail.com Created attachment 1587 --> https://issues.dlang.org/attachment.cgi?id=1587&action=edit Example of error using partial with delegate reference Trying to use "partial" from "std.function" with a variable referring to a function or delegate does not behave as expected. See "example_error.d" for unexpected behaviour. ketmar, on #d observed that the issue is either with DMD or with phobos: either `is(typeof(basic) == function)` should be true there (and then it's dmdfe bug), or `partial` should use `isCallable` (and then it's phobos bug) He was able to provide a fix with the following: i changed `static if (is(typeof(fun) == delegate) || is(typeof(fun) == function))` line in `partial` to `static if (isCallable!fun)` Which I will attach as an example. --
Feb 27 2016