@@ -41,7 +41,7 @@ module AsyncVal =
41
41
match x with
42
42
| Value v -> v
43
43
| Async a -> a |> Async.RunSynchronously
44
- | Failure f -> raise f
44
+ | Failure f -> f.Reraise ()
45
45
46
46
/// Create new AsyncVal from Async computation.
47
47
let inline ofAsync ( a : Async < 'T >) = Async( a)
@@ -54,7 +54,7 @@ module AsyncVal =
54
54
match x with
55
55
| Value v -> async.Return v
56
56
| Async a -> a
57
- | Failure f -> async.Return ( raise f )
57
+ | Failure f -> async.Return ( f.Reraise () )
58
58
59
59
/// Returns an empty AsyncVal with immediatelly executed value.
60
60
let inline empty < 'T > : AsyncVal < 'T > = AsyncVal< 'T>. Zero
@@ -111,7 +111,7 @@ module AsyncVal =
111
111
match bound with
112
112
| Value v -> return v
113
113
| Async a -> return ! a
114
- | Failure f -> return raise f
114
+ | Failure f -> return f.Reraise ()
115
115
})
116
116
| Failure f -> Failure( f)
117
117
@@ -133,7 +133,7 @@ module AsyncVal =
133
133
let! r = a
134
134
results.[ i] <- r
135
135
| Failure f ->
136
- results.[ i] <- raise f
136
+ results.[ i] <- f.Reraise ()
137
137
return results })
138
138
else Value ( values |> Array.map ( fun ( Value v ) -> v))
139
139
@@ -156,7 +156,7 @@ module AsyncVal =
156
156
indexes.Add i
157
157
continuations.Add a
158
158
| Failure f ->
159
- results.[ i] <- raise f
159
+ results.[ i] <- f.Reraise ()
160
160
if indexes.Count = 0
161
161
then Value( results)
162
162
else Async( async {
@@ -193,7 +193,7 @@ type AsyncValBuilder () =
193
193
match bound with
194
194
| Value v -> return v
195
195
| Async a -> return ! a
196
- | Failure f -> return raise f })
196
+ | Failure f -> return f.Reraise () })
197
197
198
198
199
199
[<AutoOpen>]
0 commit comments