www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18850] New: Template overload incorrectly results in

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

          Issue ID: 18850
           Summary: Template overload incorrectly results in recursive
                    expansion error
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: johnnymarler gmail.com

bug.d
----------------------------
struct Foo(T)
{
    alias Foo = Foo!(T, T.init);
}
struct Foo(T, T initialValue)
{
    private T value = initialValue;
}
Foo!int n;
----------------------------

 dmd -c file.d
bug.d(3): Error: template instance `Foo!(T, T.init)` recursive template expansion bug.d(9): Error: template instance `bug.Foo!int` error instantiating --
May 10 2018