www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - ambiguous definition

reply "Pasqui23" <ppp23 example.com> writes:
Hi.
I was editing std.string,but when I tried to compile it it game
me this error:

string.d(368): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar), candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(369): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar), candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(370): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar), candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(371): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar), candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(373): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(374): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(375): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(376): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, dchar, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(377): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, wchar, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(380): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, char, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(381): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, char, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(553): Error: undefined identifier S
string.d(382): Error: template std.string.indexOf cannot deduce
function from argument types !()(string, char, CaseSensitive),
candidates are:
string.d(306):        std.string.indexOf(S)(S s, ElementType!S c,
CaseSensitive cs = CaseSensitive.yes) if (isSomeString!S ||
isInputRange!S && isSomeChar!(ElementType!S))
string.d(404):        std.string.indexOf(S)(S s, ElementType!S c,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isInputRange!S && isSomeChar!(ElementType!S))
string.d(468):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
CaseSensitive cs = CaseSensitive.yes) if
(is(Unqual!(ElementType!S1) == Unqual!(ElementType!S2)) &&
(isSomeString!S1 || isSomeChar!(ElementType!S1) &&
isForwardRange!S1 && isForwardRange!S2))
string.d(551):        std.string.indexOf(S1, S2)(S1 s, S2 sub,
const size_t startIdx, CaseSensitive cs = CaseSensitive.yes) if
(isSomeString!S || isForwardRange!S1 && isForwardRange!S2 &&
isSomeChar!(ElementType!S1))
string.d(368): Error: template std.string.indexOf cannot deduce
function from argument types !()(immutable(wchar)[], dchar),
candidates are:


and here the source code: http://pastebin.com/ATZKwQ34
Mar 10 2014
parent "Andrej Mitrovic" <andrej.mitrovich gmail.com> writes:
On Monday, 10 March 2014 at 22:45:36 UTC, Pasqui23 wrote:
 Hi.
 I was editing std.string,but when I tried to compile it it game
 me this error:
One of the errors in git-head is: test.d(553): Error: undefined identifier S Check your constraints, isSomeString!S should have been isSomeString!S1 or isSomeString!S2.
Apr 13 2014