www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7904] New: Template instantiation failure depending on compilation order

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: thecybershadow gmail.com



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: -------
Apr 13 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7904


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
This looks like a duplicate of issue 7852, although the error messages are
different.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 21 2012