Skip to content

Commit 3be23a2

Browse files
authored
Merge pull request #1022 from WolframResearch/bugfix/456137
Workaround for `Enclose` issue
2 parents aee3d3b + dda7781 commit 3be23a2

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Source/Chatbook/Common.wl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,12 +311,19 @@ expandThrowInternalFailures[ expr_ ] :=
311311
ReplaceAll[
312312
HoldPattern[ e$: lhs ] :> rhs,
313313
HoldPattern @ Enclose[ eval_, throwInternalFailure, $enclosure ] :>
314-
Enclose[ eval, throwInternalFailure[ e$, ##1 ] &, $enclosure ]
314+
Module[ { eh = HoldComplete @ e$ }, Enclose[ eval, internalFailureFunction @ eh, $enclosure ] ]
315315
]
316316
];
317317

318318
expandThrowInternalFailures // endDefinition;
319319

320+
(* ::**************************************************************************************************************:: *)
321+
(* ::Subsubsection::Closed:: *)
322+
(*internalFailureFunction*)
323+
internalFailureFunction // ClearAll;
324+
internalFailureFunction // Attributes = { HoldAllComplete };
325+
internalFailureFunction[ held_ ][ args___ ] := Replace[ held, HoldComplete[ e_ ] :> throwInternalFailure[ e, args ] ];
326+
320327
(* ::**************************************************************************************************************:: *)
321328
(* ::Subsubsection::Closed:: *)
322329
(*addEnclosureTags*)

0 commit comments

Comments
 (0)