www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Bug 105] New: abiguity for opCall

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=105

           Summary: abiguity for opCall
           Product: D
           Version: 0.150
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: benoit tionex.de


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)


-- 
Apr 13 2006
next sibling parent Thomas Kuehne <thomas-dloop kuehne.cn> writes:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

d-bugmail puremagic.com 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.d http://dstress.kuehne.cn/run/m/mixin_20_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFERI4p3w+/yD4P9tIRAp+RAKDENdrJNKU7v0r6FFNL62zZCIbh0wCeIpEi z+cw8ZQk2F0Tp0Ujhq83OYY= =4q/n -----END PGP SIGNATURE-----
Apr 17 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/bugzilla/show_bug.cgi?id=105


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from bugzilla digitalmars.com  2006-04-28 02:56 -------
Fixed 0.155


-- 
Apr 28 2006