@@ -14,7 +14,7 @@ let require b at s = if not b then error at s
1414
1515(* Context *)
1616
17- type label_kind = BodyLabel | BlockLabel | TryLabel | CatchLabel
17+ type label_kind = BlockLabel | CatchLabel
1818
1919type context =
2020{
@@ -409,7 +409,7 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
409409
410410 | TryCatch (bt , es , cts , ca ) ->
411411 let FuncType (ts1, ts2) as ft = check_block_type c bt in
412- let c_try = {c with labels = (TryLabel , ts2) :: c.labels} in
412+ let c_try = {c with labels = (BlockLabel , ts2) :: c.labels} in
413413 let c_catch = {c with labels = (CatchLabel , ts2) :: c.labels} in
414414 check_block c_try es ft e.at;
415415 List. iter (fun ct -> check_catch ct c_catch ft e.at) cts;
@@ -419,8 +419,8 @@ let rec check_instr (c : context) (e : instr) (s : infer_stack_type) : op_type =
419419 | TryDelegate (bt , es , x ) ->
420420 let FuncType (ts1, ts2) as ft = check_block_type c bt in
421421 let (kind, _) = label c x in
422- require (kind = TryLabel || kind = BodyLabel ) e.at " invalid delegate label" ;
423- check_block {c with labels = (TryLabel , ts2) :: c.labels} es ft e.at;
422+ require (kind = BlockLabel ) e.at " invalid delegate label" ;
423+ check_block {c with labels = (BlockLabel , ts2) :: c.labels} es ft e.at;
424424 ts1 --> ts2
425425
426426 | Throw x ->
@@ -524,7 +524,7 @@ let check_type (t : type_) =
524524let check_func (c : context ) (f : func ) =
525525 let {ftype; locals; body} = f.it in
526526 let FuncType (ts1, ts2) = type_ c ftype in
527- let c' = {c with locals = ts1 @ locals; results = ts2; labels = [(BodyLabel , ts2)]} in
527+ let c' = {c with locals = ts1 @ locals; results = ts2; labels = [(BlockLabel , ts2)]} in
528528 check_block c' body (FuncType ([] , ts2)) f.at
529529
530530let check_tag (c : context ) (t : tag ) =
0 commit comments