http://d.puremagic.com/issues/show_bug.cgi?id=3379
Summary: [tdpl] Parameter names not visible in the if clause of a template Product: D Version: unspecified Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: and...@metalanguage.com --- Comment #0 from Andrei Alexandrescu <and...@metalanguage.com> 2009-10-08 14:25:57 PDT --- This code does not compile: T1[] find(T1, T2)(T1[] longer, T2[] shorter) if (is(typeof(longer[0 .. 1] == shorter) : bool)) { while (longer.length >= shorter.length) { if (longer[0 .. shorter.length] == shorter) break; longer = longer[1 .. $]; } return longer; } unittest { double[] d1 = [ 6.0, 1.5, 2.4, 3 ]; double[] d2 = [ 1.5, 2.4 ]; assert(find(d1, d2) == d1[1 .. $]); } (I believe I'd submitted this bug already. Please don't mark as duplicate so all TDPL-related errors stay together.) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------