Comment #0 by bearophile_hugs — 2010-03-08T15:27:19Z
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
}
Comment #1 by schveiguy — 2010-03-09T04:15:46Z
*** This issue has been marked as a duplicate of issue 1807 ***