Bug 662 – Allow UFCS for basic types and enums

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2006-12-07T04:22:00Z
Last change time
2015-06-09T05:14:47Z
Assigned to
bugzilla
Creator
lovesyao
Depends on
6277

Attachments

IDFilenameSummaryContent-TypeSize
82call_r3.diffpatchtext/plain1454

Comments

Comment #0 by lovesyao — 2006-12-07T04:22:42Z
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; }
Comment #1 by lovesyao — 2006-12-07T04:23:46Z
Created attachment 82 patch
Comment #2 by k.hara.pg — 2012-04-13T22:46:36Z
UFCS for all basic types and enums is implemented in dmd 2.059.