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

--- Comment #5 from Daniel X <[email protected]> ---
(In reply to Walter Bright from comment #3)
> Test cases are much better if they don't import libraries

Gotcha. Updated for convenience:

------
enum isCopyable(S) = is(typeof(
    { S foo = S.init; S copy = foo; }
));

struct SumType(T) {
    static if (!isCopyable!T)
        @disable this(this);
}

struct CallbackType1 {
    bool[Class1] func;   // changing to Class1[] compiles OK
}

// moving Class1 above CallbackType1 compiles OK
class Class1 {
    SumType!CallbackType1 _callback;
    this(SumType!CallbackType1 callback) { // commenting out this ctor compiles
OK
        _callback = callback;
    }
}

--

Reply via email to