[Issue 24759] New: Order-dependent failure to create an overload set with template function

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 10 19:09:15 UTC 2024


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

          Issue ID: 24759
           Summary: Order-dependent failure to create an overload set with
                    template function
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: maxsamukha at gmail.com

module b;

void foo() {}
----

module a;

import b;

void foo(T)(T a) {}
alias foo = b.foo;

void main()
{
    foo();
    foo(1);
}
----

a.d(6): Error: alias `a.foo` conflicts with template `a.foo(T)(T a)` at a.d(5)

The test case compiles if the alias declaration preceeds the template
declaration.

--


More information about the Digitalmars-d-bugs mailing list