diff --git a/changelog/dmd.deprecations.dd b/changelog/dmd.deprecations.dd index 6798828b357d..a53fd2fb786d 100644 --- a/changelog/dmd.deprecations.dd +++ b/changelog/dmd.deprecations.dd @@ -1,3 +1,5 @@ Many deprections have been turned in errors Using `return` statements in scope guards is now an error (in addition to contracts and `try...finally`) + +Throwing `Throwable`s of qualified types diff --git a/compiler/src/dmd/statementsem.d b/compiler/src/dmd/statementsem.d index 8e2cde049d1a..d755fe12d6ce 100644 --- a/compiler/src/dmd/statementsem.d +++ b/compiler/src/dmd/statementsem.d @@ -3936,10 +3936,8 @@ public bool throwSemantic(Loc loc, ref Expression exp, Scope* sc) return false; if (!exp.type.isNaked) { - // @@@DEPRECATED_2.112@@@ - // Deprecated in 2.102, change into an error & return false in 2.112 - exp.loc.deprecation("cannot throw object of qualified type `%s`", exp.type.toErrMsg()); - //return false; + error(exp.loc, "cannot throw object of qualified type `%s`", exp.type.toErrMsg()); + return false; } checkThrowEscape(*sc, exp, false); diff --git a/compiler/test/fail_compilation/ice10651.d b/compiler/test/fail_compilation/ice10651.d index 8b6c7200bb72..a3af45f7ae14 100644 --- a/compiler/test/fail_compilation/ice10651.d +++ b/compiler/test/fail_compilation/ice10651.d @@ -2,8 +2,8 @@ TEST_OUTPUT: --- fail_compilation/ice10651.d(13): Error: can only throw class objects derived from `Throwable`, not type `int*` -fail_compilation/ice10651.d(19): Deprecation: cannot throw object of qualified type `immutable(Exception)` -fail_compilation/ice10651.d(20): Deprecation: cannot throw object of qualified type `const(Dummy)` +fail_compilation/ice10651.d(19): Error: cannot throw object of qualified type `immutable(Exception)` +fail_compilation/ice10651.d(20): Error: cannot throw object of qualified type `const(Dummy)` --- */