e.g.:
import std.traits;
struct X
{
@disable this(this); // make uncopyable
pragma(msg, isCopyable!X); // true!
}
pragma(msg, isCopyable!X); // true unless pragma above is commented out
Inspecting whether a struct is copyable inside the struct seems to return that it is, even when it should be disabled. If you remove the inspection inside, then the outer instantiation becomes false.
The use case I have is declaring a static member that works with instances of the struct inside the struct itself.
I initially was thinking this was a Phobos bug, but I think it's an issue with the compiler.
Comment #1 by robert.schadek — 2024-12-13T19:06:17Z