www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16437] New: Enum type inference

https://issues.dlang.org/show_bug.cgi?id=16437

          Issue ID: 16437
           Summary: Enum type inference
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: b2.temp gmx.com

inference of the enum type in function calls, allowing to type only the member


Enum A{a0}

void foo(A a);
a0.foo; // OK

void bar(T)(T t);
a0.bar; // ERROR

void baz(A[] a);
[a0].baz; //OK

void cli(A a)();
cli!a0; // OK

This could be accepted as long as the parameter type is not inferred since the
parameter type will have to be used to find a match in the enum.

--
Aug 27 2016