Skip to content

Commit

Permalink
Merge pull request #305 from John-Colvin/noreturn
Browse files Browse the repository at this point in the history
use noreturn
  • Loading branch information
atilaneves authored Sep 28, 2023
2 parents 6ab4437 + f299bba commit 2024c9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion source/unit_threaded/light.d
Original file line number Diff line number Diff line change
Expand Up @@ -499,8 +499,9 @@ private void assert_(bool value, string message, string file, size_t line) @safe
throw new Exception(message, file, line);
}

void fail(string output, string file, size_t line) @safe pure {
noreturn fail(string output, string file, size_t line) @safe pure {
assert_(false, output, file, line);
assert(0);
}


Expand Down
8 changes: 4 additions & 4 deletions subpackages/exception/source/unit_threaded/exception.d
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ module unit_threaded.exception;
import std.sumtype;
import std.typecons;

void fail(const string output, const string file, size_t line) @safe pure
noreturn fail(const string output, const string file, size_t line) @safe pure
{
throw new UnitTestException([output], file, line);
}

void fail(const string[] lines, const string file, size_t line) @safe pure
noreturn fail(const string[] lines, const string file, size_t line) @safe pure
{
throw new UnitTestException(lines, file, line);
}

package void fail(Throwable throwable) @safe pure
package noreturn fail(Throwable throwable) @safe pure
{
throw new UnitTestException(throwable);
}

package void fail(Throwable throwable, Throwable.TraceInfo traceInfo, int removeExtraLines) @safe pure
package noreturn fail(Throwable throwable, Throwable.TraceInfo traceInfo, int removeExtraLines) @safe pure
{
throw new UnitTestException(throwable, traceInfo, removeExtraLines);
}
Expand Down

0 comments on commit 2024c9f

Please sign in to comment.