[Issue 662] New: Support functions as basictypes and enum properties

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Dec 7 02:22:50 PST 2006


http://d.puremagic.com/issues/show_bug.cgi?id=662

           Summary: Support functions as basictypes and enum properties
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: lovesyao at hotmail.com


module prop;
import std.stdio,std.string;
enum Etest{
  a,b,c,d
}

typedef int testi = 10;
typedef Test Test2;

void main(){
  assert(22 .toString() == "22");
  assert((new Test).test(11)==11);
  assert(Test.test(11)==11);
  assert(Test2.test(11)==11);
  assert(test()==33);
  assert(prop.test()==33);
  assert(Etest.d.test()==Etest.d);
  testi i;
  assert(i.test()==i.init);
}

int test(){return 33;};

class Test{
  static int test(int i){return i;};
}

int test(Etest test){
  return cast(int)test;
}

int test(testi i){
  return cast(int)i;
}


-- 




More information about the Digitalmars-d-bugs mailing list