code sample: import std.typecons, std.stdio; class A { this() { writeln("A"); } ~this() { writeln("~A"); } } interface Bob {} class ABob : A, Bob { this() { writeln("ABob"); } ~this() { writeln("~ABob"); } } void main() { auto abob = scoped!ABob(); } ABob is just a normal class, and creating an instance of it on the stack shouldn't be a problem, but scoped fails to instantiate because std.typecons.destroy fails to instantiate: /usr/include/d2/4.6.0/std/typecons.d:2571: Error: template std.typecons.destroy(T) if (is(T == class)) does not match any function template declaration /usr/include/d2/4.6.0/std/typecons.d:2571: Error: template std.typecons.destroy(T) if (is(T == class)) cannot deduce template function from argument types !()(A,Bob) /usr/include/d2/4.6.0/std/typecons.d:2530: Error: template instance std.typecons.destroy!(ABob) error instantiating scopedtest.d:18: instantiated from here: scoped!(ABob,) scopedtest.d:18: Error: template instance std.typecons.scoped!(ABob,) error instantiating This error is interesting: cannot deduce template function from argument types !()(A,Bob) it looks like we're getting some sort of tuple of ABob's superclasses, trying to instantiate destroy on it, and failing. The correct behavior should be to special case classes that implement interfaces so the interfaces are ignored when figuring out how to call destructors.
Fix merged https://github.com/D-Programming-Language/phobos/pull/199