6 fail_compilation/noreturn2.d(18): Error: expected return type of `noreturn`, not `void`
9 https://github.com/dlang/DIPs/blob/master/DIPs/accepted/DIP1034.md
12 alias noreturn
= typeof(*null);
25 fail_compilation/noreturn2.d(37): Error: expected return type of `int`, not `string`:
26 fail_compilation/noreturn2.d(35): Return type of `int` inferred here.
43 fail_compilation/noreturn2.d(50): Error: function `noreturn2.returns` is typed as `NR` but does return
44 fail_compilation/noreturn2.d(50): `noreturn` functions must either throw, abort or loop indefinitely
52 // Fallthrough despite noreturn
58 fail_compilation/noreturn2.d(64): Error: cannot implicitly convert expression `1` of type `int` to `noreturn`
62 noreturn
returnsValue()
70 fail_compilation/noreturn2.d(75): Error: expected return type of `int`, not `void`
81 fail_compilation/noreturn2.d(89): Error: mismatched function return type inference of `void` and `int`
84 auto returnVoid3(int i
)
95 fail_compilation/noreturn2.d(104): Error: `object.Exception` is thrown but not caught
96 fail_compilation/noreturn2.d(100): Error: function `noreturn2.doesNestedThrow` may throw but is marked as `nothrow`
100 int doesNestedThrow(int i
) nothrow
102 // Weird formatting is intended to check the loc
110 int doesNestedThrowThrowable(int i
) nothrow
112 return i ? i
++ : throw new Error("");
118 fail_compilation/noreturn2.d(130): Error: cannot create instance of interface `I`
119 fail_compilation/noreturn2.d(133): Error: can only throw class objects derived from `Throwable`, not type `int[]`
120 fail_compilation/noreturn2.d(138): Error: undefined identifier `UnkownException`
124 int throwInvalid(int i
) nothrow
126 static interface I
{}
127 // Weird formatting is intended to check the loc
144 https://issues.dlang.org/show_bug.cgi?id=24054
147 fail_compilation/noreturn2.d(153): Error: cannot return from `noreturn` function
148 fail_compilation/noreturn2.d(153): Consider adding an endless loop, `assert(0)`, or another `noreturn` expression