Skip to content

Commit a3865eb

Browse files
ntreldlang-bot
authored andcommitted
[stable] [changelog] Add item for noreturn main
1 parent b051cc6 commit a3865eb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

changelog/main_return_type.dd

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
`main` can now return type `noreturn` and supports return inference
2+
3+
If `main` never returns (due to an infinite loop or always throwing an
4+
exception), it can now be declared as returning `noreturn`.
5+
See https://dlang.org/spec/type.html#noreturn.
6+
7+
If `main` is declared with `auto`, the inferred return type must be
8+
one of `void`, `int` and `noreturn`.
9+

0 commit comments

Comments
 (0)