Thread overview
[Bug 105] New: abiguity for opCall
Apr 13, 2006
d-bugmail
Apr 18, 2006
Thomas Kuehne
Apr 28, 2006
d-bugmail
April 13, 2006
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)


-- 

April 18, 2006
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


April 28, 2006
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


--