wrong function overload

Karen Lanrap karen at digitaldaemon.com
Wed Sep 27 08:32:35 PDT 2006


import std.stdio;
enum COLOR{RED};
enum TYPE{SOFT_TOP};
class Car{
    int val;
    void roof( COLOR c)
    {
      val= 1;
    }
    void roof(TYPE t, int i)
    {
      val= 2;
    }
}
void main(){
    auto mycar= new Car;
    mycar.roof( TYPE.SOFT_TOP); // should not compile
    writefln( mycar.val); // should print 2
}



More information about the Digitalmars-d-bugs mailing list