Skip to content

Commit 0e72b39

Browse files
committed
Add changelog
1 parent e3abe9a commit 0e72b39

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Attribute violations in default arguments now emit deprecations
2+
3+
Calling an impure, `@system`, or non-`@nogc` function in a default argument
4+
of a `pure`, `@safe`, or `@nogc` function was silently accepted.
5+
These violations are now reported as deprecations.
6+
7+
```d
8+
int stderr() => 0;
9+
void write(int outfile = stderr()) pure {}
10+
11+
void main() pure
12+
{
13+
write(); // stderr() gets inserted as argument
14+
}
15+
```
16+
17+
$(CONSOLE
18+
test.d(2): Deprecation: `pure` function `main` calling impure function `stderr` in default argument
19+
)

0 commit comments

Comments
 (0)