[Issue 6385] isInputRange!(ubyte[2u]) is a failure when used in global scope
http://d.puremagic.com/issues/show_bug.cgi?id=6385 klickverbot c...@klickverbot.at changed: What|Removed |Added Status|NEW |RESOLVED CC||c...@klickverbot.at Resolution||DUPLICATE --- Comment #4 from klickverbot c...@klickverbot.at 2011-09-05 14:31:14 PDT --- *** This issue has been marked as a duplicate of issue 6602 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6385] isInputRange!(ubyte[2u]) is a failure when used in global scope
http://d.puremagic.com/issues/show_bug.cgi?id=6385 --- Comment #5 from klickverbot c...@klickverbot.at 2011-09-05 14:37:06 PDT --- I think the problem described above didn't occur if the isInputRange instantiation is inside a function, because then the instance was added to the global list later, during semantic3, and TemplateInstance::semantic3 immediately exists if this.error is set, whereas TemplateInstance::semantic doesn't bail out early. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6385] isInputRange!(ubyte[2u]) is a failure when used in global scope
http://d.puremagic.com/issues/show_bug.cgi?id=6385 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment #3 from yebblies yebbl...@gmail.com 2011-08-27 21:06:24 EST --- (In reply to comment #2) The test case was accidentally fixed by commit: https://github.com/D-Programming-Language/dmd/commit/dc83c but I don't really understand why. It seems to be just luck. dc83c prevents dmd from re-evaluating the template constraint when the args match an instance that already exists. Previously the constraint would be run unless all template args had a spec. You can see this by changing 'void bug6385(A)(A a) if (template6385!A)' to 'void bug6385(A : ubyte[2])(A a) if (template6385!A)'. Slightly smaller test case: void templ6385(A)(A a) if ( { return false; }() ) { this_is_an_error(); } const bool bool6385 = is(typeof( { this_is_another_error(); templ6385(1); }() )); void main() {} Using an older commit, it seems that the cause is re-running semantic on templ6385, as it's been added to the list of module members. This seems to be similar to issue 4302 (caused by the fix to bug 4042) but missed by the patch in 4302. Changing - if (!(sc-flags SCOPEstaticif)) + if (!(sc-flags SCOPEstaticif) !sc-intypeof) from that patch seems to fix it, but I have no idea if there are any other missing cases. My guess at a correct solution is that http://www.dsource.org/projects/dmd/changeset/477 is incorrect, and should instead remove the TemplateInstance from the module's list of members. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6385] isInputRange!(ubyte[2u]) is a failure when used in global scope
http://d.puremagic.com/issues/show_bug.cgi?id=6385 Don clugd...@yahoo.com.au changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #2 from Don clugd...@yahoo.com.au 2011-08-26 04:37:04 PDT --- Reduced test case. It seems this bug is quite complicated, it requires two semantic errors, plus uniform function call syntax, and a template constraint: template template6385(T) { enum template6385 = false; } void bug6385(A)(A a) if (template6385!A) { this_is_an_error(); } const bool bool6385 = is(typeof( { ubyte[2] r; this_is_another_error(); r.bug6385; }() )); The test case was accidentally fixed by commit: https://github.com/D-Programming-Language/dmd/commit/dc83c but I don't really understand why. It seems to be just luck. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 6385] isInputRange!(ubyte[2u]) is a failure when used in global scope
http://d.puremagic.com/issues/show_bug.cgi?id=6385 --- Comment #1 from Steven Schveighoffer schvei...@yahoo.com 2011-07-26 11:21:28 PDT --- BTW, this compiles on 2.051, fails on 2.052 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---