[Issue 5406] [patch] Major regressions in std.algorithm for functions relying on is(typeof(binaryFun!... due to a static assert in binaryFunImpl
http://d.puremagic.com/issues/show_bug.cgi?id=5406 Lars T. Kyllingstad bugzi...@kyllingen.net changed: What|Removed |Added CC||bugzi...@kyllingen.net --- Comment #1 from Lars T. Kyllingstad bugzi...@kyllingen.net 2011-02-03 00:23:39 PST --- Do you have a test case? I tried your example find(goodbye, bye); and it works for me. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5406] [patch] Major regressions in std.algorithm for functions relying on is(typeof(binaryFun!... due to a static assert in binaryFunImpl
http://d.puremagic.com/issues/show_bug.cgi?id=5406 --- Comment #2 from Rob Jacques sandf...@jhu.edu 2011-02-03 09:46:11 PST --- I apologize for the bad test case. In retrospect, I believe I didn't try to reduce it, I simply extrapolated the issue from the error message reported. Here is a properly test case: import std.string; pragma(msg, replace(int.stringof,int,real)); Which generates the error: C:\dmd2\src\phobos\std\functional.d(177): Error: static assert Bad binary function q{a == b}. You need to use a valid D expression using symbols a of type dchar and b of type const(char)[]. C:\dmd2\src\phobos\std\functional.d(180):instantiated from here: Body!(dchar,const(char)[]) C:\dmd2\src\phobos\std\algorithm.d(2149):instantiated from here: result!(dchar,const(char)[]) What got me was that algorithm.d(2149) turns out to be: 2147: R find(alias pred = a == b, R, E)(R haystack, E needle) 2148: if (isInputRange!R 2149: is(typeof(binaryFun!pred(haystack.front, needle)) : bool)) However, this only seems to generate a bug in certain compile-time contexts. For example, enum bug = replace(int.stringof,int,real); compiles, while: import std.typetuple; mixin( alias TypeTuple!(~replace(int.stringof,int,real)~) This2Algebraic;); doesn't. Although I don't know how/why find is called. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5406] [patch] Major regressions in std.algorithm for functions relying on is(typeof(binaryFun!... due to a static assert in binaryFunImpl
http://d.puremagic.com/issues/show_bug.cgi?id=5406 Rob Jacques sandf...@jhu.edu changed: What|Removed |Added Status|NEW |RESOLVED Resolution||DUPLICATE --- Comment #3 from Rob Jacques sandf...@jhu.edu 2011-02-03 14:58:35 PST --- As identified by soul...@gmail.com, this appears to be identical to Issue 5373 - Regression (2.051) CTFE and std.string.replace() causes Bad binary function q{a == b}... *** This issue has been marked as a duplicate of issue 5373 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---