D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 2393 - Regression(1.032, D1 only) IFTI on (T:char)(T[]) vs (T:dchar)(T[])
Summary: Regression(1.032, D1 only) IFTI on (T:char)(T[]) vs (T:dchar)(T[])
Status: RESOLVED WONTFIX
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 regression
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2008-10-04 17:05 UTC by Nick Sabalausky
Modified: 2014-03-01 00:36 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 Nick Sabalausky 2008-10-04 17:05:00 UTC
The following code worked fine in 1.029, but is broken in 1.033 and 1.035 (no other versions tested):

void fooA(T:char) (T chr) { }
void fooA(T:dchar)(T chr) { }

void fooB(T:char) (T[] str) { }
void fooB(T:dchar)(T[] str) { }

void main()
{
	// Ok in all versions
	fooA('c');
	
	// DMD 1.029: Ok
	// DMD 1.033 and 1.035: template main.fooB(T : char) fooB(T : char) matches more than one function template declaration, fooB(T : char) and fooB(T : dchar)
	fooB("str"c);
}
Comment 1 Don 2010-01-25 01:28:25 UTC
It worked on 1.030. For D2, it was fixed in 2.023.
Comment 2 Don 2010-08-31 02:29:56 UTC
This worked on 1.031, but fails on 1.032 and later.
Comment 3 Walter Bright 2012-01-31 19:11:10 UTC
The way this was 'fixed' in D2 was to type string literals as dynamic arrays rather than static ones, along with various other string literal changes. Applying this fix to D1 breaks the test suite. I'm concerned that this would be a disruptive change to D1, rather than an improvement, which is not what we should be doing for D1 users.