www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10343] New: Cannot resolve a forward reference to a template inside global typeof

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



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: -------
Jun 12 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10343


Tomoya Tanjo <ttanjo gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



I found it can be compiled without errors in trunk (v2.064-devel-fbbdba5).
Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 06 2013