[Issue 19585] New: Invalid recursive template expansion error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 15 08:12:37 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19585

          Issue ID: 19585
           Summary: Invalid recursive template expansion error
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ben.schaaf at gmail.com

Versions: 2.081.1, 2.083.0 (What I had installed)

The following code produces a compiler error when it shouldn't:

struct A {
    M2 stdin;
}

mixin template Handle(T, T invalid_value = T.init) {}

struct M1 { mixin Handle!(size_t); }
struct M2 { mixin Handle!(M1); }

template `foo.Handle(T, T invalid_value = T.init)` recursive template expansion

Not using the struct doesn't produce an error, so clearly expanding M2 works
perfectly. Using M1.init instead of relying on the default parameter doesn't
produce this issue.

--


More information about the Digitalmars-d-bugs mailing list