[Issue 8542] crosstalk between template instantiations
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Oct 16 17:24:06 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8542
hsteoh at quickfur.ath.cx changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hsteoh at quickfur.ath.cx
--- Comment #4 from hsteoh at quickfur.ath.cx 2012-10-16 17:24:02 PDT ---
Here's a somewhat simpler case:
auto cprod(R1,R2)(R1 A, R2 B)
{
return zip(sequence!"n"(cast(size_t)0), A.save, B.save, repeat(A),
repeat(B))
.map!(function(a) => chain(
zip(repeat(a[1]), take(a[4].save,a[0])),
zip(take(a[3].save,a[0]+1), repeat(a[2]))
)).joiner;
}
void main()
{
auto A = sequence!"2*n"(0);
auto B = sequence!"2*n+1"(0);
auto AB = cprod(A,B);
auto C = sequence!"100+n"(0);
auto D = sequence!"200+n"(0);
auto CD = cprod(C,D);
}
Produces the error:
Error: function
test3.cprod!(Sequence!("2*n",Tuple!(int)),Sequence!("2*n+1",Tuple!(int))).cprod.map!(__
funcliteral2).map!(Zip!(Sequence!("n",Tuple!(uint)),Sequence!("100+n",Tuple!(int)),Sequence!("200+n",Tupl
e!(int)),Repeat!(Sequence!("100+n",Tuple!(int))),Repeat!(Sequence!("200+n",Tuple!(int))))).map
is a neste
d function and cannot be accessed from
test3.cprod!(Sequence!("100+n",Tuple!(int)),Sequence!("200+n",Tupl
e!(int))).cprod
Commenting out either the first three lines (A, B, AB) or the second three
lines (C, D, CD) makes the problem go away.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list