D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3660 - Templates and shared functions don't mix
Summary: Templates and shared functions don't mix
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 critical
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2009-12-31 19:27 UTC by Jason House
Modified: 2015-06-09 01:27 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jason House 2009-12-31 19:27:50 UTC
Sample code:

=========================
struct foo{
  void bar(T)(T t){}
  void bar(T)(T t) shared {}
}
void main(){
  foo x;
  x.bar(1);
}
=========================

Result with dmd 2.037:
$ dmd test.d
test.d(7): Error: template test.foo.bar(T) matches more than one function template declaration:
  bar(T)
and:
  bar(T)
Comment 1 Walter Bright 2010-01-13 03:05:24 UTC
Changeset 335
Comment 2 Walter Bright 2010-01-30 22:46:17 UTC
fixed dmd 2.040