www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 662] New: Support functions as basictypes and enum properties

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: lovesyao 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;
}


-- 
Dec 07 2006
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=662





------- Comment #1 from lovesyao hotmail.com  2006-12-07 04:23 -------
Created an attachment (id=82)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=82&action=view)
patch


-- 
Dec 07 2006
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=662


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 26 2010