@@ -13,7 +13,7 @@ static class SafeFireAndForgetExtensions
1313 /// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
1414 public static void SafeFireAndForget ( this ValueTask task , in Action < Exception > ? onException = null , in bool continueOnCapturedContext = false )
1515 {
16- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
16+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
1717 }
1818
1919 /// <summary>
@@ -25,7 +25,7 @@ public static void SafeFireAndForget(this ValueTask task, in Action<Exception>?
2525 /// <typeparam name="T">The return value of the ValueTask.</typeparam>
2626 public static void SafeFireAndForget < T > ( this ValueTask < T > task , in Action < Exception > ? onException = null , in bool continueOnCapturedContext = false )
2727 {
28- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
28+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
2929 }
3030
3131 /// <summary>
@@ -37,7 +37,7 @@ public static void SafeFireAndForget<T>(this ValueTask<T> task, in Action<Except
3737 /// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
3838 public static void SafeFireAndForget < TException > ( this ValueTask task , in Action < TException > ? onException = null , in bool continueOnCapturedContext = false ) where TException : Exception
3939 {
40- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
40+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
4141 }
4242
4343 /// <summary>
@@ -50,7 +50,7 @@ public static void SafeFireAndForget<TException>(this ValueTask task, in Action<
5050 /// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
5151 public static void SafeFireAndForget < T , TException > ( this ValueTask < T > task , in Action < TException > ? onException = null , in bool continueOnCapturedContext = false ) where TException : Exception
5252 {
53- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
53+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
5454 }
5555
5656#if NET8_0_OR_GREATER
@@ -62,7 +62,7 @@ public static void SafeFireAndForget<T, TException>(this ValueTask<T> task, in A
6262 /// <param name="configureAwaitOptions">Options to control behavior when awaiting</param>
6363 public static void SafeFireAndForget ( this Task task , in ConfigureAwaitOptions configureAwaitOptions , in Action < Exception > ? onException = null )
6464 {
65- HandleSafeFireAndForget ( task , configureAwaitOptions , onException ) ;
65+ _ = HandleSafeFireAndForget ( task , configureAwaitOptions , onException ) ;
6666 }
6767
6868 /// <summary>
@@ -74,7 +74,7 @@ public static void SafeFireAndForget(this Task task, in ConfigureAwaitOptions co
7474 /// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
7575 public static void SafeFireAndForget < TException > ( this Task task , in ConfigureAwaitOptions configureAwaitOptions , in Action < TException > ? onException = null ) where TException : Exception
7676 {
77- HandleSafeFireAndForget ( task , configureAwaitOptions , onException ) ;
77+ _ = HandleSafeFireAndForget ( task , configureAwaitOptions , onException ) ;
7878 }
7979#endif
8080
@@ -86,7 +86,7 @@ public static void SafeFireAndForget<TException>(this Task task, in ConfigureAwa
8686 /// <param name="continueOnCapturedContext">If set to <c>true</c>, continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to <c>false</c>, continue on a different context; this will allow the Synchronization Context to continue on a different thread</param>
8787 public static void SafeFireAndForget ( this Task task , in Action < Exception > ? onException = null , in bool continueOnCapturedContext = false )
8888 {
89- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
89+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
9090 }
9191
9292 /// <summary>
@@ -98,10 +98,10 @@ public static void SafeFireAndForget(this Task task, in Action<Exception>? onExc
9898 /// <typeparam name="TException">Exception type. If an exception is thrown of a different type, it will not be handled</typeparam>
9999 public static void SafeFireAndForget < TException > ( this Task task , in Action < TException > ? onException = null , in bool continueOnCapturedContext = false ) where TException : Exception
100100 {
101- HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
101+ _ = HandleSafeFireAndForget ( task , continueOnCapturedContext , onException ) ;
102102 }
103103
104- static async void HandleSafeFireAndForget < TException > ( ValueTask valueTask , bool continueOnCapturedContext , Action < TException > ? onException ) where TException : Exception
104+ static async Task HandleSafeFireAndForget < TException > ( ValueTask valueTask , bool continueOnCapturedContext , Action < TException > ? onException ) where TException : Exception
105105 {
106106 try
107107 {
@@ -113,7 +113,7 @@ static async void HandleSafeFireAndForget<TException>(ValueTask valueTask, bool
113113 }
114114 }
115115
116- static async void HandleSafeFireAndForget < T , TException > ( ValueTask < T > valueTask , bool continueOnCapturedContext , Action < TException > ? onException ) where TException : Exception
116+ static async Task HandleSafeFireAndForget < T , TException > ( ValueTask < T > valueTask , bool continueOnCapturedContext , Action < TException > ? onException ) where TException : Exception
117117 {
118118 try
119119 {
@@ -125,7 +125,7 @@ static async void HandleSafeFireAndForget<T, TException>(ValueTask<T> valueTask,
125125 }
126126 }
127127
128- static async void HandleSafeFireAndForget < TException > ( Task task ,
128+ static async Task HandleSafeFireAndForget < TException > ( Task task ,
129129 bool continueOnCapturedContext ,
130130 Action < TException > ? onException ) where TException : Exception
131131 {
@@ -140,7 +140,7 @@ static async void HandleSafeFireAndForget<TException>(Task task,
140140 }
141141
142142#if NET8_0_OR_GREATER
143- static async void HandleSafeFireAndForget < TException > ( Task task , ConfigureAwaitOptions configureAwaitOptions , Action < TException > ? onException ) where TException : Exception
143+ static async Task HandleSafeFireAndForget < TException > ( Task task , ConfigureAwaitOptions configureAwaitOptions , Action < TException > ? onException ) where TException : Exception
144144 {
145145 try
146146 {
0 commit comments