https://issues.dlang.org/show_bug.cgi?id=17730
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] Component|dmd |phobos Hardware|x86_64 |All OS|Linux |All --- Comment #1 from Walter Bright <[email protected]> --- Breaking it down to the following code: import std.algorithm; T moveImpl(T)(ref T source) { T result = void; moveEmplace(source, result); return result; } T trustedMoveImpl(T)(ref T source) @trusted { return moveImpl(source); } T move(T)(ref T source) { // test @safe destructible static if (__traits(compiles, (T t) @safe {})) return trustedMoveImpl(source); // this is the path taken else return moveImpl(source); } class A { } A makeA() @safe { scope a = new A(); return move(a); // should fail } The trouble is that moveEmplace() is @system, but trustedMoveImpl() paints it to be @trusted, thus defeating the scope checks. Re-categorized as a Phobos issue. --
