https://issues.dlang.org/show_bug.cgi?id=20211 --- Comment #1 from anonymous4 <dfj1esp02 at sneakemail.com> --- Try this: template A() { int[] f(scope int[] a) @safe { return a; } } static assert(!__traits(compiles,A!())); --