[Issue 7904] New: Template instantiation failure depending on compilation order

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 13 22:03:02 PDT 2012


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

           Summary: Template instantiation failure depending on
                    compilation order
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: thecybershadow at gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow at gmail.com> 2012-04-13 22:03:50 PDT ---
=== a.d ===
import std_algorithm;
=== b.d ===
import std_algorithm;

void f()
{
    startsWith("", "");
}
=== std_algorithm.d ===
dchar front(A)(A) { }

uint startsWith()() { }

bool startsWith(R1, R2)(R1 doesThisStart, R2)
if (is(typeof(doesThisStart.front)))
{
    return true;
}
=== compiler command line ===
dmd -o- a.d b.d
=== compiler output ===
b.d(5): Error: template std_algorithm.startsWith does not match any function
template declaration
b.d(5): Error: template std_algorithm.startsWith cannot deduce template
function from argument types !()(string,string)

Changing the order of files on the command line unbreaks compilation.

-- 
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