This is a bug with the gagging system. auto quz(X)(X y) { X q = "abc"; return y; } static assert(!is(typeof(quz!int(6)))); Two additional tests: // It should also be false the second time; static assert(!is(typeof(quz!int(18)))); // This should print error messages. int bolog = quz!int(27);
This was fixed in DMD2.056, commit 8ed5854. Test case is in the test suite.