While a function works fine, opCall does not:
import std.stdio;
template T( int i ){
public void foo(){
writefln( "%d", i );
}
public void opCall(){ // line 9
writefln( "%d", i );
}
}
class C{
}
class C1 : C {
mixin T!( 1 ) t1;
mixin T!( 2 ) t2;
}
void main(){
C1 c1 = new C1;
c1.t1.foo();
c1.t1(); // this causes the error
}
snippets/opCall.d(9): function snippets.opCall.C1.mixin T!(1);
.opCall conflicts with snippets.opCall.C1.mixin T!(2);
.opCall at snippets/opCall.d(9)
Comment #1 by thomas-dloop — 2006-04-18T01:35:26Z
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
[email protected] schrieb am 2006-04-13:
> While a function works fine, opCall does not:
>
> import std.stdio;
>
> template T( int i ){
> public void foo(){
> writefln( "%d", i );
> }
> public void opCall(){ // line 9
> writefln( "%d", i );
> }
> }
>
> class C{
> }
>
> class C1 : C {
> mixin T!( 1 ) t1;
> mixin T!( 2 ) t2;
> }
>
> void main(){
> C1 c1 = new C1;
> c1.t1.foo();
> c1.t1(); // this causes the error
> }
Added to DStress as
http://dstress.kuehne.cn/run/m/mixin_20_A.dhttp://dstress.kuehne.cn/run/m/mixin_20_B.d
Thomas
-----BEGIN PGP SIGNATURE-----
iD8DBQFERI4p3w+/yD4P9tIRAp+RAKDENdrJNKU7v0r6FFNL62zZCIbh0wCeIpEi
z+cw8ZQk2F0Tp0Ujhq83OYY=
=4q/n
-----END PGP SIGNATURE-----