Bug 10095 – Regression (git-head): Cannot resolve type for template instance

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-16T07:12:00Z
Last change time
2013-05-16T09:21:38Z
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-05-16T07:12:52Z
----- import std.conv; string foo(alias var, T = typeof(var))() { foreach (idx, member; __traits(allMembers, T)) { to!string(var.tupleof[idx]); // without this the error is gone } return ""; } string foo(T)(T var) // without this the error is gone { return ""; } struct S { int i; string s; } void main() { S s = S(1, ""); auto x = foo!s; } ----- 2.062 $ dmd test.d > 2.063: $ dmd test.d > test.d(29): Error: cannot resolve type for foo!(s) > test.d(29): Error: cannot infer type from template instance foo!(s)
Comment #1 by k.hara.pg — 2013-05-16T09:21:38Z
*** This issue has been marked as a duplicate of issue 10096 ***