[Issue 1474] New: regression: const struct with an initializer not recognized as a valid alias template param

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 5 12:50:50 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1474

           Summary: regression: const struct with an initializer not
                    recognized as a valid alias template param
           Product: D
           Version: 1.021
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: h3r3tic at mat.uni.torun.pl


template Foo(alias a) {}

struct Bar {}
const Bar bar = {};

alias Foo!(bar) baz;
// ----

constaliasbug.d(6): template instance Foo!(Bar()) does not match any template
declaration

Works in dmd 1.020, works when the initializer is removed from "bar"'s
declaration: 'const Bar bar;' (invalid in gdc, iirc), and works when 'bar' is
not const.

This bug breaks Bind, btw.


-- 



More information about the Digitalmars-d-bugs mailing list