www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14438] New: is(A P == super) (tuple of supertypes) should


          Issue ID: 14438
           Summary: is(A P == super) (tuple of supertypes) should work
                    with structs and alias this
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: andrei erdani.com

Currently D offers a means to get all supertypes (base class and implemented
interfaces) of a class types with this construct:

static if (is(C P == super))

Inside the static if, P is a tuple starting with the base class and continuing
with all implemented interfaces, in lexical order.

Now consider:

struct S(T)
    private T datum;
    T fun() { return datum; }
    alias fun this;

There is no introspection mechanism that, given S, finds T. There should be
one, and it should work with the upcoming multiple alias this.

I think it's fine if we use the same syntax.

Apr 10 2015