[Issue 10586] New: DMD unable to interpret cascaded template calls at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 9 11:31:59 PDT 2013


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

           Summary: DMD unable to interpret cascaded template calls at
                    compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: puneet at coverify.org


--- Comment #0 from Puneet Goel <puneet at coverify.org> 2013-07-09 11:31:58 PDT ---
I am using latest github dmd -- 712c3e256b1198523bb8a5c49e5e08d3f8409855

Here is the minimized code for the regression. 

$ dmd -c bvec.d
foo.d(12): Error: Cannot interpret FooSize!N at compile time
foo.d(13):        while evaluating SIZE.init
foo.d(13):        while looking for match for FooParams!(1LU)
foo.d(9): Error: template instance foo.foo!1 error instantiating

I think the regression got introduced while fixing 10579.


// Regression Code starts here
private template FooParams(size_t SIZE) {
  private alias ubyte StoreT;
}

template FooSize(size_t N=1) {
  enum size_t FooSize = N;
}

enum foo!1 BIT_0   = foo!1.init;

struct foo(size_t N)  {
    enum size_t SIZE = FooSize!N;
    private alias FooParams!(SIZE).StoreT store_t;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list