D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4467 - type deduction fails when combining array() and uniq()
Summary: type deduction fails when combining array() and uniq()
Status: RESOLVED DUPLICATE of issue 4363
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2010-07-15 15:55 UTC by Jesse Phillips
Modified: 2010-07-15 19:40 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 Jesse Phillips 2010-07-15 15:55:40 UTC
This code (or code similar to it) use to work within the last 4 releases. I don't know whether it is a bug in Phobos or DMD.

import std.algorithm;
import std.array;

void main() {
	auto a = ["hello", "there", "you", "allow", "you", "me"];

	auto b = array(uniq(a));
}

test.d(7): Error: template std.array.array(Range) if (isForwardRange!(Range)) does not match any function template declaration
test.d(7): Error: template std.array.array(Range) if (isForwardRange!(Range)) cannot deduce template function from argument types !()(Uniq!(pred,string[]))
Comment 1 yebblies 2010-07-15 19:40:14 UTC
This is a phobos bug caused by the addition of save() to the definition of a forward range.
Uniq is one of around 22 ranges in phobos that appear to be forward ranges but have not been updated to meet this requirement. (bug4363)

*** This issue has been marked as a duplicate of issue 4363 ***