Skip to content

Commit 6155e26

Browse files
authored
doesnotreturn (#386)
1 parent 97e4d6f commit 6155e26

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

BitFaster.Caching/Throw.cs

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,35 @@ namespace BitFaster.Caching
77
{
88
internal static class Throw
99
{
10-
public static void ArgNull(ExceptionArgument arg) => throw CreateArgumentNullException(arg);
11-
12-
public static void ArgOutOfRange(string paramName) => throw CreateArgumentOutOfRangeException(paramName);
13-
10+
#if NETCOREAPP3_0_OR_GREATER
11+
[DoesNotReturn]
12+
#endif
13+
public static void ArgNull(ExceptionArgument arg) => throw CreateArgumentNullException(arg);
14+
15+
#if NETCOREAPP3_0_OR_GREATER
16+
[DoesNotReturn]
17+
#endif
18+
public static void ArgOutOfRange(string paramName) => throw CreateArgumentOutOfRangeException(paramName);
19+
20+
#if NETCOREAPP3_0_OR_GREATER
21+
[DoesNotReturn]
22+
#endif
1423
public static void ArgOutOfRange(string paramName, string message) => throw CreateArgumentOutOfRangeException(paramName, message);
1524

1625
[ExcludeFromCodeCoverage]
17-
public static void InvalidOp(string message) => throw CreateInvalidOperationException(message);
18-
26+
#if NETCOREAPP3_0_OR_GREATER
27+
[DoesNotReturn]
28+
#endif
29+
public static void InvalidOp(string message) => throw CreateInvalidOperationException(message);
30+
31+
#if NETCOREAPP3_0_OR_GREATER
32+
[DoesNotReturn]
33+
#endif
1934
public static void ScopedRetryFailure() => throw CreateScopedRetryFailure();
2035

36+
#if NETCOREAPP3_0_OR_GREATER
37+
[DoesNotReturn]
38+
#endif
2139
public static void Disposed<T>() => throw CreateObjectDisposedException<T>();
2240

2341
[MethodImpl(MethodImplOptions.NoInlining)]

0 commit comments

Comments
 (0)