is this a dmd bug ?

Long Chang changedalone at gmail.com
Tue Nov 24 04:38:51 PST 2009


how about this case:


public interface Listener {
    void handleEvent (int);
}

class Test{
    this(){
        Listener listener    = new class() Listener {
            public void handleEvent(int evt) {
                toString(evt);
            }
        };
    }

    void toString(int evt){

    }
}

void main(){

}

---------------------------------------
x.d(17): Error: function object.Object.toString () does not match parameter
types (int)
x.d(17): Error: expected 0 arguments, not 1 for non-variadic function type
char[]()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20091124/aebe396f/attachment.html>


More information about the Digitalmars-d mailing list