[Issue 4841] -inline wrecks delegate literals as alias parameters (An array()/map inlining problem)
http://d.puremagic.com/issues/show_bug.cgi?id=4841 David Simcha changed: What|Removed |Added CC||dsim...@yahoo.com --- Comment #3 from David Simcha 2012-01-24 13:41:43 PST --- *** Issue 4724 has been marked as a duplicate of this issue. *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4841] -inline wrecks delegate literals as alias parameters (An array()/map inlining problem)
http://d.puremagic.com/issues/show_bug.cgi?id=4841 Trass3r changed: What|Removed |Added CC||mrmoc...@gmx.de --- Comment #2 from Trass3r 2012-01-16 12:41:31 PST --- I think the following test case also belongs to this issue: R1 find(alias pred = "a == b", R1, R2)(R1 haystack, R2 needle) { return simpleMindedFind!pred(haystack, needle); } R1 simpleMindedFind(alias pred, R1, R2)(R1 haystack, R2 needle) { bool haystackTooShort() { return true; } return haystack; } sizediff_t indexOf(Char1, Char2)(const(Char1)[] s, const(Char2)sub) { const(Char1)[] balance = find!({})(s, sub); return -1; } string extStr; void main() { extStr.indexOf("bla"); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4841] -inline wrecks delegate literals as alias parameters (An array()/map inlining problem)
http://d.puremagic.com/issues/show_bug.cgi?id=4841 Don changed: What|Removed |Added CC||clugd...@yahoo.com.au Summary|An array()/map inlining |-inline wrecks delegate |problem |literals as alias ||parameters (An array()/map ||inlining problem) --- Comment #1 from Don 2010-09-10 00:02:24 PDT --- Original title: "An array()/map inlining problem" Here's a simpler case that gives the same error message, only with -inline: --- struct Struct4841(alias pred) { this(int k) { } } void bug4841a() { Struct4841!( (t) { any_old_garbage;} )( 1 ); } void bug4841b() { bug4841a(); } --- This is a problem with delegates and alias templates. It's not a regression. There also seems to be an accepts-invalid bug in this. You can put any old garbage inside the alias, which seems odd. And you cannot declare a variable of type Struct4841!( (t) { any_old_garbage;} ) --- it's rejected at the parsing stage. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---