Skip to content

Commit dc5a98b

Browse files
authored
[spec] Disallow throwing qualified objects (#3476)
See dlang/dmd#14706
1 parent 6e9fbb1 commit dc5a98b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

spec/expression.dd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,6 +1484,11 @@ $(P
14841484
throw new Exception("message");
14851485
---
14861486

1487+
$(P
1488+
The `Throwable` must not be a qualified as `immutable`, `const`, `inout` or
1489+
`shared`. The runtime may modify a thrown object (e.g. to contain a stack
1490+
trace) which would violate `const` or `immutable` objects.
1491+
)
14871492
$(P
14881493
A $(I ThrowExpression) may be nested in another expression:
14891494
)

0 commit comments

Comments
 (0)