@@ -239,32 +239,49 @@ type TryFinally =
239239
240240 static member TryFinally (( computation : unit -> Id < _ > , compensation : unit -> unit ), _ : TryFinally , _ , _ ) = try computation () finally compensation ()
241241 static member TryFinally (( computation : unit -> Async < _ >, compensation : unit -> unit ), _ : TryFinally , _ , _ ) = async.TryFinally ( computation (), compensation) : Async<_>
242- #if ! FABLE_ COMPILER
243- static member TryFinally (( computation : unit -> Task < _ > , compensation : unit -> unit ), _ : TryFinally , _ , True ) = Task.tryFinally computation compensation : Task<_>
244- #endif
245242 static member TryFinally (( computation : unit -> Lazy < _ > , compensation : unit -> unit ), _ : TryFinally , _ , _ ) = lazy ( try ( computation ()) .Force () finally compensation ()) : Lazy<_>
246243
247244 static member inline Invoke ( source : '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` =
248245 let inline call ( mthd : 'M , input : unit -> 'I , _output : 'I , h : unit -> unit ) = (( ^M or ^I ) : ( static member TryFinally : (_*_)*_*_*_ -> _) ( input, h), mthd, Unchecked.defaultof< TryFinally>, False)
249246 call ( Unchecked.defaultof< TryFinally>, ( fun () -> source), Unchecked.defaultof< '`` Monad<'T> `` >, f)
250247
251- static member inline InvokeForStrict ( source : unit -> '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` =
252- let inline call ( mthd : 'M , input : unit -> 'I , _output : 'I , h : unit -> unit ) = (( ^M or ^I ) : ( static member TryFinally : (_*_)*_*_*_ -> _) ( input, h), mthd, Unchecked.defaultof< TryFinally>, True)
253- call ( Unchecked.defaultof< TryFinally>, source, Unchecked.defaultof< '`` Monad<'T> `` >, f)
254-
255- static member inline InvokeOnInstance ( source : '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` = (^ `` Monad<'T> `` : ( static member TryFinally : _*_ -> _) source, f) : '`` Monad<'T> ``
248+ static member inline InvokeOnInstance ( source : '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` = printfn " Try Finally default 8 for %A " typeof< ^ `` Monad<'T> `` >; (^ `` Monad<'T> `` : ( static member TryFinally : _*_ -> _) source, f) : '`` Monad<'T> ``
256249
257250type TryFinally with
251+ static member inline TryFinally (( computation : unit -> '``Monad < 'T > `` , compensation : unit -> unit ), _ : Default1 , _ : TryFinally , _defaults : False ) = TryFinally.InvokeOnInstance ( computation ()) compensation: '`` Monad<'T> ``
252+ static member inline TryFinally (( _ : unit -> ^t when ^t : null and ^t : struct , _ : unit -> unit ), _ : Default1 , _ : TryFinally , _ ) = ()
253+
254+ type TryFinallyS =
255+ inherit Default1
256+
257+ [<CompilerMessage( MessageTryFinally, CodeTryFinally, IsError = true ) >]
258+ static member TryFinally (( _ : unit -> 'R -> _ , _ : unit -> unit ), _ : Default2 , _ , _defaults : False ) = raise Internals.Errors.exnUnreachable
259+
260+ static member TryFinally (( computation : unit -> Id < _ > , compensation : unit -> unit ), _ : TryFinallyS , _ , _ ) = try computation () finally compensation ()
261+ #if ! FABLE_ COMPILER
262+ static member TryFinally (( computation : unit -> Task < _ > , compensation : unit -> unit ), _ : TryFinallyS , _ , True ) = Task.tryFinally computation compensation : Task<_>
263+ #endif
264+
265+ static member inline Invoke ( source : unit -> '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` =
266+ let inline call ( mthd : 'M , input : unit -> 'I , _output : 'I , h : unit -> unit ) = (( ^M or ^I ) : ( static member TryFinally : (_*_)*_*_*_ -> _) ( input, h), mthd, Unchecked.defaultof< TryFinallyS>, True)
267+ call ( Unchecked.defaultof< TryFinallyS>, source, Unchecked.defaultof< '`` Monad<'T> `` >, f)
268+
269+ static member inline InvokeOnInstance ( source : unit -> '``Monad < 'T > ``) ( f : unit -> unit ) : '``Monad < 'T > `` = (^ `` Monad<'T> `` : ( static member TryFinally : _*_ -> _) source, f) : '`` Monad<'T> ``
270+
271+ type TryFinallyS with
258272
259273 [<CompilerMessage( MessageTryFinally, CodeTryFinally, IsError = true ) >]
260274 static member TryFinally (( _ : unit -> '``Monad < 'T > `` when '``Monad<'T>`` : struct , _ : unit -> unit ), _ : Default3 , _ : Default2 , _defaults : False ) = raise Internals.Errors.exnUnreachable
261275
262276 [<CompilerMessage( MessageTryFinally, CodeTryFinally, IsError = true ) >]
263277 static member TryFinally (( _ : unit -> '``Monad < 'T > `` when '``Monad<'T>`` : not struct , _ : unit -> unit ), _ : Default3 , _ : Default1 , _defaults : False ) = raise Internals.Errors.exnUnreachable
264278
265- static member TryFinally (( computation : unit -> '``Monad < 'T > ``, compensation : unit -> unit ), _ : Default1 , _ : TryFinally , _defaults : True ) = try computation () finally compensation ()
266- static member inline TryFinally (( computation : unit -> '``Monad < 'T > ``, compensation : unit -> unit ), _ : Default1 , _ : TryFinally , _defaults : False ) = TryFinally.InvokeOnInstance ( computation ()) compensation: '`` Monad<'T> ``
267- static member inline TryFinally (( _ : unit -> ^t when ^t : null and ^t : struct , _ : unit -> unit ), _ : Default1 , _ , _ ) = ()
279+ static member TryFinally (( computation : unit -> '``Monad < 'T > `` when '``Monad<'T>`` : struct , compensation : unit -> unit ), _ : Default3 , _ : Default2 , _defaults : True ) = try computation () finally compensation ()
280+ static member TryFinally (( computation : unit -> '``Monad < 'T > `` when '``Monad<'T>`` : not struct , compensation : unit -> unit ), _ : Default3 , _ : Default1 , _defaults : True ) = try computation () finally compensation ()
281+
282+ static member inline TryFinally (( computation : unit -> '``Monad < 'T > `` , compensation : unit -> unit ), _ : Default1 , _ : TryFinallyS , _defaults : _ ) = TryFinallyS.InvokeOnInstance computation compensation: '`` Monad<'T> ``
283+ static member inline TryFinally (( _ : unit -> ^t when ^t : null and ^t : struct , _ : unit -> unit ), _ : Default1 , _ , _ ) = ()
284+
268285
269286type Using =
270287 inherit Default1
0 commit comments