Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: finally to also clean up after trapping continuations #4507

Merged
merged 207 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
207 commits
Select commit Hold shift + click to select a range
f113ced
amend `S.TryE`
ggreif Apr 22, 2024
9a82bde
interpret the happy path
ggreif Apr 22, 2024
7ebb915
postcompose on the `catch` paths too
ggreif Apr 22, 2024
de5ba2a
add prelim. test
ggreif Apr 23, 2024
d193689
complicate the test a bit
ggreif Apr 24, 2024
1d384d5
show that `catch` works, `return` not
ggreif Apr 24, 2024
6403328
nested `try`, no cigar!
ggreif Apr 25, 2024
290b184
fix up the return continuation too
ggreif Apr 25, 2024
cfe61aa
check that `finally` not running twice
ggreif Apr 29, 2024
32ba4f6
test `break`
ggreif Apr 29, 2024
9933eca
fix up outwards label continuations
ggreif Apr 29, 2024
f73231a
accept IR interpreters
ggreif Apr 30, 2024
d6763a0
checkpoint
ggreif Apr 30, 2024
fc64612
add a todo
ggreif May 2, 2024
25464c3
happy path when `unit` result
ggreif May 2, 2024
023b4ee
accept IR happy
ggreif May 2, 2024
86ec31a
simplify for special case
ggreif May 2, 2024
90e247d
post compose cleanup with cases too
ggreif May 2, 2024
8d649be
cleanup
ggreif May 2, 2024
a419d80
WIP
ggreif May 2, 2024
2f455bf
WIP
ggreif May 6, 2024
82f355a
more WIP
ggreif May 7, 2024
0e4d181
sharing fix
ggreif May 7, 2024
8bc89b7
WIP: analyse the context
ggreif May 8, 2024
f8fb9b0
WIP
ggreif May 8, 2024
7dd2eaa
disable flawed check
ggreif May 10, 2024
278f860
WIP: try precomposing the `finally`-thunk on the label continuation
ggreif May 13, 2024
ebdeeb7
use the respons variable
ggreif May 13, 2024
a428afa
WIP: try to implement the nested `try` case
ggreif May 13, 2024
6c7f0ad
cleanup
ggreif May 13, 2024
4791040
test with `drun`
ggreif May 14, 2024
f0e15e8
tweaks
ggreif May 14, 2024
067a35b
more tweaks
ggreif May 14, 2024
7456f5a
`Label` cannot happen, see `BreakPrim` below
ggreif May 14, 2024
60cd293
cleanups
ggreif May 14, 2024
5f82252
test `return`
ggreif May 14, 2024
1e59052
cover `Return` "labels" too
ggreif May 14, 2024
279f61e
cleanup
ggreif May 14, 2024
e3713c2
tweaks
ggreif May 17, 2024
85ee9b7
WIP
ggreif May 22, 2024
70e96b7
WIP: more
ggreif May 22, 2024
c6a1329
WIP: roll back some wrong ideas
ggreif May 22, 2024
63fc12f
tweaks
ggreif May 22, 2024
120c313
WIP: undo more
ggreif May 22, 2024
8726208
tweak
ggreif May 22, 2024
ef93fb3
WIP: cleanups
ggreif May 23, 2024
10e38dd
tweak
ggreif May 23, 2024
a9e93bc
WIP: start propagating the cleanup
ggreif May 23, 2024
cf03986
tweaks
ggreif May 24, 2024
c0ad414
WIP: back towards plan A
ggreif May 28, 2024
88420fb
WIP: some progress with ir_check
ggreif May 29, 2024
ae35133
WIP: minimal progress
ggreif May 29, 2024
4659205
WIP: progress
ggreif May 29, 2024
4daf367
WIP: unalias things
ggreif May 31, 2024
93a05a7
WIP: revert a few things and fix others
ggreif May 31, 2024
8823455
WIP: towards backend support for the third continuation
ggreif Jun 3, 2024
0b92793
WIP: fixup `future_array_index`
ggreif Jun 3, 2024
3a2e4bc
invoke the cleanup closure
ggreif Jun 4, 2024
6ad57d7
WIP: checkpoint
ggreif Jun 4, 2024
c73e61b
WIP: back to business
ggreif Jun 5, 2024
108b188
WIP: twist & shout!
ggreif Jun 5, 2024
8efe8c9
cleanup a bit
ggreif Jun 6, 2024
ab73471
tweak
ggreif Jun 6, 2024
f515bda
WIP: set up the `Cleanup` chain
ggreif Jun 6, 2024
4cce7fe
WIP: fix typing
ggreif Jun 6, 2024
0a84c5d
WIP: store the chain on `enqueue`
ggreif Jun 6, 2024
2ca816c
introduce `finally` keyword and update parser
ggreif Jun 7, 2024
eb4c53c
fix `ICCallRawPrim` and remove some obsolete changes
ggreif Jun 7, 2024
a9e84d1
new keyword
ggreif Jun 7, 2024
88b3a7e
add test for raw
ggreif Jun 7, 2024
0b5cfeb
enable `t6` again
ggreif Jun 7, 2024
38ebdac
WIP: cover the "trap after second `await`" case
ggreif Jun 8, 2024
f5ed26b
add `t0d` test which exercises the double-`await` codegen
ggreif Jun 10, 2024
fe343c1
improve comment
ggreif Jun 10, 2024
5cc86c6
add negative testcase
ggreif Jun 11, 2024
4a62db7
add error for messaging from `finally`
ggreif Jun 11, 2024
2d6e27e
another fixme
ggreif Jun 11, 2024
1ef333e
fix
ggreif Jun 11, 2024
f440e29
fix a syntax quirk
ggreif Jun 11, 2024
027430e
remove obsolete
ggreif Jun 11, 2024
2ff67b0
accept
ggreif Jun 12, 2024
fe5e6af
add tests for nested last-resort cleanups
ggreif Jun 12, 2024
1a6ac26
allow non-unit resuts for `try`
ggreif Jun 12, 2024
58a906c
WIP: reduce IR sharing by reconstructing the `VarE`
ggreif Jun 13, 2024
0c28b83
WIP: fix the type of the cleanup continuation
ggreif Jun 13, 2024
3b6a956
fixes and tweaks
ggreif Jun 13, 2024
4c84e41
tweaks
ggreif Jun 13, 2024
76214cd
communicate intent better (not done yet)
ggreif Jun 14, 2024
eed2ba3
WIP: prepare for elimination of nat32
ggreif Jun 14, 2024
6338f22
clean-up
ggreif Jun 14, 2024
c8ffb0c
align
ggreif Jun 14, 2024
33b4e64
simplify
ggreif Jun 14, 2024
11f2e47
undo
ggreif Jun 14, 2024
2c7ccbe
simplify the type for `@cleanup`
ggreif Jun 14, 2024
b010d40
these are equal types, but slightly different semantics
ggreif Jun 14, 2024
222aab8
fix for completeness
ggreif Jun 14, 2024
a096356
yet
ggreif Jun 19, 2024
0522458
simplify the logic
ggreif Jun 19, 2024
d5ba0c9
WIP: try to pass `var` via `TryE`
ggreif Jun 19, 2024
1afaf35
fix the import loop
ggreif Jun 19, 2024
064ef7f
tweak
ggreif Jun 20, 2024
2f5fc5e
WIP: improve the aliasing situation by eta-expansion
ggreif Jun 20, 2024
09c0575
fix the aliasing situation using `varE` just-in-time
ggreif Jun 20, 2024
3b21f51
done (almost)
ggreif Jun 20, 2024
16a4f84
WIP: first shot at the IR-interpreter
ggreif Jun 20, 2024
ce0c3f5
WIP: activate the interpreters
ggreif Jun 24, 2024
3c9b323
more tests
ggreif Jun 24, 2024
ed4e6d9
WIP: arrange the non-trapping ones to the front
ggreif Jun 24, 2024
93e73f7
another test
ggreif Jun 24, 2024
54e7f93
expose the double invocation in `src/mo_interpreter/interpret.ml`
ggreif Jun 24, 2024
cbc658b
fix the double-invocation
ggreif Jun 24, 2024
9c13b49
tweak
ggreif Jun 24, 2024
dd1dc6a
typos
ggreif Jun 24, 2024
3da4290
interpreting `TryE` makes only sense in non-lowered code, as it gets …
ggreif Jun 24, 2024
837dd18
fix the IR interpreter
ggreif Jun 24, 2024
8fcfb8b
cleanup
ggreif Jun 24, 2024
89b5a08
accept
ggreif Jun 24, 2024
eb7c7f2
add a test that traps in `catch`
ggreif Jun 25, 2024
aceb323
test trap in nested `catch`
ggreif Jun 25, 2024
70cb14b
first `async*` test
ggreif Jun 25, 2024
b3c0a60
add `Changelog.md` entry for `finally`
ggreif Jun 25, 2024
d727380
add another `await*` testcase
ggreif Jun 26, 2024
606a945
more `await*` tests
ggreif Jun 26, 2024
65e585e
arrange the finally thunk
ggreif Jun 27, 2024
813ede9
arrange the finally expression
ggreif Jun 27, 2024
62c298d
elim a FIXME
ggreif Jun 27, 2024
ae686d6
preserve the `Cleanup` chain for `await` and `await*`
ggreif Jun 27, 2024
560cbca
test `async* { ... }` trapping too
ggreif Jun 27, 2024
da124b2
reverts
ggreif Jun 27, 2024
f39b966
tweaks
ggreif Jun 27, 2024
5938aca
point to security best practices
ggreif Jun 27, 2024
d47e978
tweak
ggreif Jun 27, 2024
24cab37
words
ggreif Jun 27, 2024
2f6b6ef
italic
ggreif Jun 27, 2024
f1faeab
smith
ggreif Jun 27, 2024
bf93408
this needs to be done
ggreif Jun 28, 2024
b1480db
IR-interpreter: pass through the _cleanup_ continuation
ggreif Jun 28, 2024
f058d40
refactor
ggreif Jun 28, 2024
f3dadd3
simplify by assuming that `Cleanup` cont exists already
ggreif Jun 28, 2024
3b95664
tweaks
ggreif Jun 28, 2024
0a1e759
reject `throw` from `finally`
ggreif Jun 28, 2024
d8ef292
prohibit `return` and accessing external labels
ggreif Jul 1, 2024
40aab57
WIP: start implementing the `Triv` block
ggreif Jul 1, 2024
aaf7f17
pre-massage the continuations
ggreif Jul 1, 2024
0b6c528
Merge branch 'master' into gabor/finally
ggreif Jul 3, 2024
0775cd3
use builtin
ggreif Jul 1, 2024
1ea9792
out-edge from `catch`
ggreif Jul 3, 2024
3f041f5
step towards deduplication
ggreif Jul 3, 2024
1c95539
now we can deduplicate
ggreif Jul 3, 2024
f83da8b
WIP: remove the `finally`-insertion from `desugar.ml` and add it to `…
ggreif Jul 4, 2024
c4bd5b1
fix the re-`throw` to not ignore a `finally`
ggreif Jul 4, 2024
27bba80
simplify
ggreif Jul 4, 2024
cdb70e3
rearchitect the interpreter
ggreif Jul 4, 2024
aa63c74
correctly endow the inner environment with the precomposed `throws`
ggreif Jul 4, 2024
e9091eb
prepare for fusing
ggreif Jul 4, 2024
ecbd0d9
deduplicate
ggreif Jul 4, 2024
e65574b
indent
ggreif Jul 4, 2024
ff5227b
model the IR-interpreter after the AST one
ggreif Jul 4, 2024
0f261ac
fuse the cases
ggreif Jul 4, 2024
f511bb0
simplify
ggreif Jul 4, 2024
81e1593
Merge branch 'master' into gabor/finally
ggreif Jul 8, 2024
84aa3e2
Allow `try` without `catch` (#4600)
ggreif Jul 9, 2024
59a14d9
document `finally`
ggreif Jul 9, 2024
0fabab4
fix: this was missed when merging #4600
ggreif Jul 9, 2024
2329069
optimisation: don't rethrow if there is an irrefutable `catch` pattern
ggreif Jul 9, 2024
5f4fb41
Merge branch 'master' into gabor/finally
ggreif Jul 9, 2024
b0998cb
undo
ggreif Jul 9, 2024
47bf1d1
tweak
ggreif Jul 9, 2024
51bb8a1
remove fuzz
ggreif Jul 9, 2024
007fc75
Update src/ir_def/check_ir.ml
ggreif Jul 18, 2024
e43d309
Merge branch 'master' into gabor/finally
ggreif Jul 18, 2024
70ba3c2
post-merge fixup
ggreif Jul 18, 2024
5340312
Update src/mo_interpreter/interpret.ml
ggreif Jul 18, 2024
9c8bcb9
Update src/ir_interpreter/interpret_ir.ml
ggreif Jul 18, 2024
d848aa6
Update Changelog.md
ggreif Jul 18, 2024
580642c
Update doc/md/reference/language-manual.md
ggreif Jul 18, 2024
156ee7f
bug in checking of try catch finally that sends in finally
crusso Jul 18, 2024
7968356
bug
crusso Jul 18, 2024
ed8aae3
fix bug using NullCap; update test output; remove error code
crusso Jul 18, 2024
cddd55c
clean up test files
crusso Jul 18, 2024
50f421e
Update Changelog.md
ggreif Jul 22, 2024
db61469
Update src/ir_passes/await.ml
ggreif Jul 22, 2024
5583e03
mark as dead
ggreif Jul 22, 2024
0bf51e4
Update doc/md/reference/language-manual.md
ggreif Jul 22, 2024
1be018d
DEAD too
ggreif Jul 22, 2024
918ee82
write an explanation for `M0037`
ggreif Jul 22, 2024
a8a2c1f
Update src/prelude/internals.mo
ggreif Jul 23, 2024
64d4a27
Update src/prelude/internals.mo
ggreif Jul 23, 2024
41663c3
Update src/ir_passes/tailcall.ml
ggreif Jul 23, 2024
6bae38f
simplify
ggreif Jul 23, 2024
a3b368b
drop unused `cpsT`
ggreif Jul 23, 2024
5bffaf0
into `named` and use it to rename a local lambda
ggreif Jul 23, 2024
39a65ac
simplify
ggreif Jul 23, 2024
b475920
Update Changelog.md
ggreif Jul 23, 2024
ad234ce
Update Changelog.md
ggreif Jul 23, 2024
cb0d236
some renaming
ggreif Jul 23, 2024
1ead3f5
use bail consistently
ggreif Jul 23, 2024
86e5923
Merge branch 'master' into gabor/finally
ggreif Jul 23, 2024
f5e8882
three new other side tests
ggreif Jul 23, 2024
57ac8df
accept a couple cycles worse
ggreif Jul 23, 2024
82055b5
Update src/mo_frontend/typing.ml
ggreif Jul 24, 2024
a0e1cdc
join cases
ggreif Jul 24, 2024
7b26253
update release instructions
ggreif Jul 24, 2024
31cbcba
bind top-level cleanup conts so AwaitPrim can rely on them being in s…
crusso Jul 24, 2024
c3395a5
Merge branch 'master' into gabor/finally
ggreif Jul 24, 2024
97c8e19
Update Changelog.md
ggreif Jul 24, 2024
78a8659
add a fall-through test
ggreif Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/lowering/desugar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ and exp' at note = function
| S.OldE e -> (oldE (exp e)).it
| S.IfE (e1, e2, e3) -> I.IfE (exp e1, exp e2, exp e3)
| S.SwitchE (e1, cs) -> I.SwitchE (exp e1, cases cs)
| S.TryE (e1, cs) -> I.TryE (exp e1, cases cs)
| S.TryE (e1, cs, None) -> I.TryE (exp e1, cases cs)
| S.TryE (e1, cs, Some _ (*FIXME*)) -> I.TryE (exp e1, cases cs)
| S.WhileE (e1, e2) -> (whileE (exp e1) (exp e2)).it
| S.LoopE (e1, None) -> I.LoopE (exp e1)
| S.LoopE (e1, Some e2) -> (loopWhileE (exp e1) (exp e2)).it
Expand Down
3 changes: 2 additions & 1 deletion src/mo_def/arrange.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ module Make (Cfg : Config) = struct
| PrimE p -> "PrimE" $$ [Atom p]
| ImportE (f, _fp) -> "ImportE" $$ [Atom f]
| ThrowE e -> "ThrowE" $$ [exp e]
| TryE (e, cs) -> "TryE" $$ [exp e] @ List.map catch cs
| TryE (e, cs, None) -> "TryE" $$ [exp e] @ List.map catch cs
| TryE (e, cs, Some _)-> "TryE FINALLY" $$ [exp e] @ List.map catch cs (* FIXME *)
| IgnoreE e -> "IgnoreE" $$ [exp e]))

and exps es = List.map exp es
Expand Down
2 changes: 1 addition & 1 deletion src/mo_def/syntax.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ and exp' =
| AnnotE of exp * typ (* type annotation *)
| ImportE of (string * resolved_import ref) (* import statement *)
| ThrowE of exp (* throw exception *)
| TryE of exp * case list (* catch exception *)
| TryE of exp * case list * exp option (* catch exception / finally *)
| IgnoreE of exp (* ignore *)
(*
| FinalE of exp * exp (* finally *)
Expand Down
3 changes: 2 additions & 1 deletion src/mo_frontend/definedness.ml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ let rec exp msgs e : f = match e.it with
| OldE e -> exp msgs e
| IfE (e1, e2, e3) -> exps msgs [e1; e2; e3]
| SwitchE (e, cs) -> exp msgs e ++ cases msgs cs
| TryE (e, cs) -> exp msgs e ++ cases msgs cs
| TryE (e, cs, None) -> exp msgs e ++ cases msgs cs
| TryE (e, cs, Some f)-> exps msgs [e; f] ++ cases msgs cs
| WhileE (e1, e2) -> exps msgs [e1; e2]
| LoopE (e1, None) -> exp msgs e1
| LoopE (e1, Some e2) -> exps msgs [e1; e2]
Expand Down
2 changes: 1 addition & 1 deletion src/mo_frontend/parser.mly
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ exp_un(B) :
| IF b=exp_nullary(ob) e1=exp_nest ELSE e2=exp_nest
{ IfE(b, e1, e2) @? at $sloc }
| TRY e1=exp_nest c=catch
{ TryE(e1, [c]) @? at $sloc }
{ TryE(e1, [c], None) @? at $sloc }
(* TODO: enable multi-branch TRY (already supported by compiler)
| TRY e=exp_nest LCURLY cs=seplist(case, semicolon) RCURLY
{ TryE(e, cs) @? at $sloc }
Expand Down
4 changes: 2 additions & 2 deletions src/mo_frontend/traversals.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ let rec over_exp (f : exp -> exp) (exp : exp) : exp = match exp.it with
f { exp with it = ObjE (List.map (over_exp f) bases, List.map (over_exp_field f) efs) }
| IfE (exp1, exp2, exp3) ->
f { exp with it = IfE(over_exp f exp1, over_exp f exp2, over_exp f exp3) }
| TryE (exp1, cases) ->
f { exp with it = TryE (over_exp f exp1, List.map (over_case f) cases) }
| TryE (exp1, cases, exp2_opt) ->
f { exp with it = TryE (over_exp f exp1, List.map (over_case f) cases, Option.map (over_exp f) exp2_opt) }
| SwitchE (exp1, cases) ->
f { exp with it = SwitchE (over_exp f exp1, List.map (over_case f) cases) }
| FuncE (name, sort_pat, typ_binds, pat, typ_opt, sugar, exp1) ->
Expand Down
16 changes: 13 additions & 3 deletions src/mo_frontend/typing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ let rec is_explicit_exp e =
| ObjBlockE (_, _, dfs) ->
List.for_all (fun (df : dec_field) -> is_explicit_dec df.it.dec) dfs
| ArrayE (_, es) -> List.exists is_explicit_exp es
| SwitchE (e1, cs) | TryE (e1, cs) ->
| SwitchE (e1, cs) | TryE (e1, cs, _ (*FIXME?*)) ->
is_explicit_exp e1 &&
List.exists (fun (c : case) -> is_explicit_exp c.it.exp) cs
| BlockE ds -> List.for_all is_explicit_dec ds
Expand Down Expand Up @@ -1513,13 +1513,18 @@ and infer_exp'' env exp : T.typ =
if not env.pre then
coverage_cases "switch" env cases t1 exp.at;
t
| TryE (exp1, cases) ->
| TryE (exp1, cases, exp2_opt) ->
let t1 = infer_exp env exp1 in
let t2 = infer_cases env T.catch T.Non cases in
if not env.pre then begin
check_ErrorCap env "try" exp.at;
coverage_cases "try handler" env cases T.catch exp.at
end;
if not env.pre then
begin match exp2_opt with
| None -> ()
| Some exp2 -> check_exp_strong env T.unit exp2
end;
T.lub t1 t2
| WhileE (exp1, exp2) ->
if not env.pre then begin
Expand Down Expand Up @@ -1815,11 +1820,16 @@ and check_exp' env0 t exp : T.typ =
check_cases env t1 t cases;
coverage_cases "switch" env cases t1 exp.at;
t
| TryE (exp1, cases), _ ->
| TryE (exp1, cases, exp2_opt), _ ->
check_ErrorCap env "try" exp.at;
check_exp env t exp1;
check_cases env T.catch t cases;
coverage_cases "try handler" env cases T.catch exp.at;
if not env.pre then
begin match exp2_opt with
| None -> ()
| Some exp2 -> check_exp_strong env T.unit exp2
end;
t
(* TODO: allow shared with one scope par *)
| FuncE (_, shared_pat, [], pat, typ_opt, _sugar, exp), T.Func (s, c, [], ts1, ts2) ->
Expand Down
9 changes: 8 additions & 1 deletion src/mo_interpreter/interpret.ml
Original file line number Diff line number Diff line change
Expand Up @@ -620,10 +620,17 @@ and interpret_exp_mut env exp (k : V.value V.cont) =
interpret_exp env exp1 (fun v1 ->
interpret_cases env cases exp.at v1 k
)
| TryE (exp1, cases) ->
| TryE (exp1, cases, None) ->
let k' = fun v1 -> interpret_catches env cases exp.at v1 k in
let env' = { env with throws = Some k' } in
interpret_exp env' exp1 k
| TryE (exp1, cases, Some exp2) ->
let k' v1 =
let cleanup v2 = interpret_exp env exp2 (fun _ -> k v2) in
ggreif marked this conversation as resolved.
Show resolved Hide resolved
interpret_catches env cases exp.at v1 cleanup in
let env' = { env with throws = Some k' } in
ggreif marked this conversation as resolved.
Show resolved Hide resolved
let k'' v2 = interpret_exp env' exp2 (fun _ -> k v2) in
ggreif marked this conversation as resolved.
Show resolved Hide resolved
ggreif marked this conversation as resolved.
Show resolved Hide resolved
interpret_exp env' exp1 k''
| WhileE (exp1, exp2) ->
let k_continue = fun v -> V.as_unit v; interpret_exp env exp k in
interpret_exp env exp1 (fun v1 ->
Expand Down
1 change: 1 addition & 0 deletions test/run/ok/try-finally.comp.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
try-finally.mo:3.1-4.26: type error [M0039], misplaced try
1 change: 1 addition & 0 deletions test/run/ok/try-finally.comp.ret.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Return code 1
5 changes: 5 additions & 0 deletions test/run/ok/try-finally.diff-ir.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- try-finally.run
+++ try-finally.run-ir
@@ -1,2 +1 @@
IN
-OUT
5 changes: 5 additions & 0 deletions test/run/ok/try-finally.diff-low.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
--- try-finally.run
+++ try-finally.run-low
@@ -1,2 +1 @@
IN
-OUT
1 change: 1 addition & 0 deletions test/run/ok/try-finally.run-ir.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IN
1 change: 1 addition & 0 deletions test/run/ok/try-finally.run-low.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IN
2 changes: 2 additions & 0 deletions test/run/ok/try-finally.run.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
IN
OUT
4 changes: 4 additions & 0 deletions test/run/ok/try-finally.tc.ok
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
try-finally.mo:3.1-4.26: warning [M0145], this try handler of type
Error
does not cover value
_
4 changes: 4 additions & 0 deletions test/run/try-finally.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { debugPrint } = "mo:prim";

try { debugPrint "IN" }
case { debugPrint "OUT" };
Loading