www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17276] New: BaseClassesTuple fails on extern C++ classes that

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

          Issue ID: 17276
           Summary: BaseClassesTuple fails on extern C++ classes that
                    implement an interface without a base class
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: alexandru.ermicioi gmail.com

Given following code:
extern (C++) {
    interface Ext {
        void someext();
    }

    class E : Ext {

        void someext() {

        }
    }
}

void main() {
    import std.traits;

    pragma(msg, BaseClassesTuple!E);
}

The resulting error is:
phobos/std/traits.d(3798,24): Error: template instance
std.traits.BaseClassesTuple!(Ext) does not match template declaration
BaseClassesTuple(T) if (is(T == class))

BaseClassesTuple will fail to get list of base classes, incorrectly treating
Ext interface as a class.

It seems BaseClassesTuple was designed to be used only on D classes that are
guaranteed to extend Object class.

--
Mar 25