Skip to content

Commit

Permalink
AssumeOk fails when T == void, cause Exception matches null
Browse files Browse the repository at this point in the history
  • Loading branch information
skoppe committed Jul 20, 2021
1 parent 432cffc commit 0558f81
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/concurrency/package.d
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,10 @@ struct Result(T) {
}
void assumeOk() {
import mir.algebraic : match;
result.match!((Exception e){throw e;},(ref t){});
static if (is(T == void))
result.match!((typeof(null)){},(Exception e){throw e;},(ref t){});
else
result.match!((Exception e){throw e;},(ref t){});
}
}

Expand Down

0 comments on commit 0558f81

Please sign in to comment.