http://d.puremagic.com/issues/show_bug.cgi?id=3904
Summary: Infer function type from an alias in a template Product: D Version: 2.041 Platform: x86 OS/Version: Windows Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-03-08 15:27:19 PST --- I think the compiler can infer the type here: template Type(T) { alias T Type; } void bar(T)(Type!T t) {} void main() { int b = 1; bar!int(b); // OK bar(b); // template test.bar(T) does not match any function template declaration } Problem found by Nicolas / biozic: http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D.learn&article_id=19054 The original code was: template Graph(T) { alias T[][T] Graph; } void add_edge(T)(ref Graph!(T) graph, T source, T target) { graph[source] ~= target; } void main() { Graph!(string) graph; graph.add_edge("A", "B"); // Error } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------