The alias this could be changed to allow conversion to the base class one step at a time. I'm not happy with it since it'd essentially do a big chain down to Object and it also ignores interfaces, but it's a start:

    static if(is(T == class) && !is(T == Object))
    @property NotNull!(BaseClassesTuple!T[0]) _valueHelper() inout
    {
        assert(_value !is null); // sanity check of invariant
        return assumeNotNull(cast(BaseClassesTuple!T[0]) _value);
    }
    else
    @property inout(T) _valueHelper() inout
    {
        assert(_value !is null); // sanity check of invariant
        return _value;
    }


(Previously, it just had the second _valueHelper)

Reply via email to