Skip to content

Commit de74c75

Browse files
authored
Merge pull request #5991 from unisonweb/ceedubs/async-cancelled
2 parents 6068fab + ca360df commit de74c75

File tree

19 files changed

+713
-699
lines changed

19 files changed

+713
-699
lines changed

parser-typechecker/src/Unison/Builtin/Decls.hs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,13 @@ tlsSignedCertRef = lookupDeclRef "io2.Tls.SignedCert"
8484

8585
tlsPrivateKeyRef = lookupDeclRef "io2.Tls.PrivateKey"
8686

87-
runtimeFailureRef, arithmeticFailureRef, miscFailureRef, stmFailureRef, threadKilledFailureRef :: Reference
87+
runtimeFailureRef, arithmeticFailureRef, miscFailureRef, stmFailureRef, threadKilledFailureRef, asyncCancelledFailureRef :: Reference
8888
runtimeFailureRef = lookupDeclRef "io2.RuntimeFailure"
8989
arithmeticFailureRef = lookupDeclRef "io2.ArithmeticFailure"
9090
miscFailureRef = lookupDeclRef "io2.MiscFailure"
9191
stmFailureRef = lookupDeclRef "io2.STMFailure"
9292
threadKilledFailureRef = lookupDeclRef "io2.ThreadKilledFailure"
93+
asyncCancelledFailureRef = lookupDeclRef "io2.AsyncCancelledFailure"
9394

9495
fileModeRef, filePathRef, bufferModeRef, seekModeRef, seqViewRef :: Reference
9596
fileModeRef = lookupDeclRef "io2.FileMode"
@@ -530,6 +531,7 @@ builtinDataDecls = rs1 ++ rs
530531
(v "io2.MiscFailure", miscFailure),
531532
(v "io2.STMFailure", stmFailure),
532533
(v "io2.ThreadKilledFailure", threadKilledFailure),
534+
(v "io2.AsyncCancelledFailure", asyncCancelledFailure),
533535
(v "crypto.CryptoFailure", cryptoFailure),
534536
(v "RewriteTerm", rewriteTerm),
535537
(v "RewriteSignature", rewriteType),
@@ -799,6 +801,13 @@ builtinDataDecls = rs1 ++ rs
799801
[]
800802
[]
801803

804+
asyncCancelledFailure =
805+
DataDeclaration
806+
(Unique "f9fdcae7d12e37728dc7336097d4255c1277f1c7a46c6200e9d3d57b8d8d7273")
807+
()
808+
[]
809+
[]
810+
802811
cryptoFailure =
803812
DataDeclaration
804813
(Unique "09132bf0cc3f07db75be127d141da91fdd545adcff88866268dfd428e9879742")

unison-runtime/src/Unison/Runtime/Machine.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,8 @@ encodeExn stk exc = do
518518
(Rf.ioFailureRef, disp be, unitValue)
519519
| Just (ie :: AsyncException) <- fromException exn =
520520
(Rf.threadKilledFailureRef, disp ie, unitValue)
521+
| Just (ie :: UnliftIO.AsyncCancelled) <- fromException exn =
522+
(Rf.asyncCancelledFailureRef, disp ie, unitValue)
521523
| Just (Panic msg v) <- fromException exn,
522524
msg <- Util.Text.pack $ "panic: " ++ msg =
523525
(Rf.miscFailureRef, msg, fromMaybe unitValue v)

0 commit comments

Comments
 (0)