I can't be entirely sure, but I think you're right and it'd be a big deal if that code were used. However, currently that's dead code anyway:
(I also ran `grep mapFinally -r scala/src/`, finding no other usage).
I'd probably fix the bug you found, alternatively I'd remove mapFinally altogether since it's not tested.
What's happening is hard to explain, but I guess that if mapFinally were actually used, a finally at the right location, in an example like the following, would be skipped.
reset {
try {
f1(shift(k => throw new Exception))
} catch {
case e =>
} finally { //I'm guessing this finally could be expressed with mapFinally, but currently mapFinally is not used.
f2()
}
}
In short, mapFinally would be used to add the call to `f2()` to a ControlContext, that is a representation of the local of shift in continuation-passing style. Because of this typo, f2 is however not called when the argument of shift throws an exception, defeating the point of using `finally`.