const TestMixin = ` public void dispose() { static if( is( this.opDispose() ) ) try { this.opDispose(); } catch( Exception e ) { // TODO: add some sort of callback for failed disposals. For // now, write to stderr. Stderr.format("Disposal of {} failed with: {}", this, e); } } `; class TestClass { mixin(TestMixin); } void main() { return; }