Skip to content

Commit 4d7d006

Browse files
cristianocclaude
andcommitted
Make the exception-destruction rationale self-contained
Removing the speculative destruct_exn.md design note left this docstring pointing at a deleted file. The note's surviving conclusion - one cannot soundly ask whether an arbitrary value is an exception, and try/catch never needs to - now lives in the comment itself. Signed-Off-By: Cristiano Calcagno <ccrisccris@gmail.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PCtQiaDijUqA2fujQXvKUw
1 parent c7374cb commit 4d7d006

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

packages/@rescript/runtime/Primitive_exceptions.res

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ type js_error = {cause: exn}
4040
| None -> (* assert it is not an exception *)
4141
]}
4242
43-
This is not a problem in `try .. with` since the logic above is not expressible, see more design in [destruct_exn.md]
43+
This is not a problem in `try .. with`: a handler only asks whether the
44+
caught value matches an exception branch, never whether an arbitrary value
45+
is an exception - the question a general exception-destruction operator
46+
would force, and which cannot be answered soundly while open variants
47+
share the exception representation.
4448
*/
4549
let isExtension = (type a, e: a): bool =>
4650
if Primitive_js_extern.testAny(e) {

0 commit comments

Comments
 (0)