digitalmars.D.bugs - [Issue 5832] New: Template alias parameters are never successfully pattern matched
- d-bugmail puremagic.com (44/44) Apr 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=5832
- d-bugmail puremagic.com (10/10) Nov 09 2012 http://d.puremagic.com/issues/show_bug.cgi?id=5832
- d-bugmail puremagic.com (12/12) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=5832
- d-bugmail puremagic.com (10/10) Nov 10 2012 http://d.puremagic.com/issues/show_bug.cgi?id=5832
http://d.puremagic.com/issues/show_bug.cgi?id=5832 Summary: Template alias parameters are never successfully pattern matched Product: D Version: D2 Platform: Other OS/Version: All Status: NEW Severity: major Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: code klickverbot.at --- Comment #0 from klickverbot <code klickverbot.at> 2011-04-10 16:01:57 PDT --- The following snippet compiles with latest DMD 2 (0219a5f), but does not behave as expected: --- struct Bar(alias v) {} template isBar(T) { static if (is(T _ : Bar!(v), alias v)) { enum isBar = true; } else { enum isBar = false; } } pragma(msg, isBar!(Bar!1234)); // prints false --- According to the spec, the second parameter to the is() expression is a TemplateParameterList, and indeed using a TemplateAliasParameter compiles, but the type is never matched, i.e. the expression always yields false. The same phenomenon also occurs when trying to use a specialized template: --- struct Bar(alias v) {} template isBar(T) { enum isBar = false; } template isBar(T : Bar!(v), alias v) { enum isBar = true; } pragma(msg, isBar!(Bar!1234)); // prints false --- -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Apr 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=5832 Kenji Hara <k.hara.pg gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull, rejects-valid --- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2012-11-09 07:43:59 PST --- https://github.com/D-Programming-Language/dmd/pull/1275 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 09 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5832 --- Comment #2 from github-bugzilla puremagic.com 2012-11-10 03:06:53 PST --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/02704fdefa7539838a1441404e3e04f26d2c131f fix Issue 5832 - Template alias parameters are never successfully pattern matched https://github.com/D-Programming-Language/dmd/commit/d71edf8c1a0e986361a89aa006359ed59d3c6db4 Merge pull request #1275 from 9rnsr/fix5832 Issue 5832 - Template alias parameters are never successfully pattern matched -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012
http://d.puremagic.com/issues/show_bug.cgi?id=5832 Walter Bright <bugzilla digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED CC| |bugzilla digitalmars.com Resolution| |FIXED -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 10 2012