D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19585 - Invalid recursive template expansion error
Summary: Invalid recursive template expansion error
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P2 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-01-15 08:12 UTC by Benjamin Schaaf
Modified: 2023-01-01 06:25 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Benjamin Schaaf 2019-01-15 08:12:37 UTC
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.
Comment 1 Iain Buclaw 2022-12-27 18:01:45 UTC

*** This issue has been marked as a duplicate of issue 18646 ***
Comment 2 Dlang Bot 2022-12-28 12:46:30 UTC
dlang/dmd pull request #14745 "fix Issue 18646 - [REG 2.079.0] Recursive template expansion incorrectly reported" was merged into stable:

- 03a9ede296fcf3e881a17564471093fafba0416e by Iain Buclaw:
  fix Issue 19585 - Invalid recursive template expansion error

https://github.com/dlang/dmd/pull/14745
Comment 3 Dlang Bot 2023-01-01 06:25:02 UTC
dlang/dmd pull request #14765 "merge stable" was merged into master:

- 259c5fb785d14e83848d5262eb88f4f6fe4832dd by Iain Buclaw:
  fix Issue 19585 - Invalid recursive template expansion error

https://github.com/dlang/dmd/pull/14765