Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions changelog/dmd.deprecations.dd
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions compiler/src/dmd/statementsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions compiler/test/fail_compilation/ice10651.d
Original file line number Diff line number Diff line change
Expand Up @@ -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)`
---
*/

Expand Down
Loading