[Issue 9675] New: cyclic import causes forward reference to template error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Mar 9 08:16:47 PST 2013


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

           Summary: cyclic import causes forward reference to template
                    error
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: r.sagitario at gmx.de


--- Comment #0 from Rainer Schuetze <r.sagitario at gmx.de> 2013-03-09 08:16:44 PST ---
This code works in dmd2.062, but not in current git-head:

//////////////////////////////////////
module semantic;

import interpret;

string semanticErrorValue(T)(T arg)
{
    return null;
}
//////////////////////////////////////
module interpret;

import semantic;

class ValueT(T) 
{
    void binOp()
    {
        semanticErrorValue("");
    }
}

class WCharValue : ValueT!wchar
{
    string toStr()
    {
        return null;
    }
}
//////////////////////////////////////

"dmd -c interpret.d" works, but
"dmd -c semantic.d" causes
semantic.d(5): Error: template semantic.semanticErrorValue(T)(T arg) forward
reference to template semanticErrorValue(T)(T arg)
interpret.d(9): Error: template semantic.semanticErrorValue(T)(T arg) cannot
deduce template function from argument types !()(string)

maybe related to issue 9672

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