[Issue 10343] New: Cannot resolve a forward reference to a template inside global typeof

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 12 07:18:52 PDT 2013


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

           Summary: Cannot resolve a forward reference to a template
                    inside global typeof
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: ttanjo at gmail.com


--- Comment #0 from Tomoya Tanjo <ttanjo at gmail.com> 2013-06-12 07:18:51 PDT ---
This code does not compile on the following environment:
* DMD 64 v2.064-devel-e654595 on Linux 64bit
* DMD 64 v2.063 on Linux 64bit
* DMD 32 v2.063 on Windows 7 32bit

---- error.d starts -----
// If uncomment next line, this code can compile.
// typeof(foo!int(3)) y;
typeof(foo(1)) x;
auto foo(T)(T t) { return t; }

void main() {
}
---- error.d ends ------

I got the following messages:

$ dmd error.d
error.d(4): Error: template error.foo(T)(T t) forward reference to template
foo(T)(T t)
error.d(3): Error: template error.foo(T)(T t) cannot deduce template function
from argument types !()(int)

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