File tree 2 files changed +22
-1
lines changed
tests/unit/src/unit/issues
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -1009,11 +1009,17 @@ module Run = struct
1009
1009
match e.eexpr with
1010
1010
| TFunction tf ->
1011
1011
let get_t t = if ExtType. is_void t then tf.tf_type else t in
1012
+ let doesnt_like_complex_expressions = match actx.com.platform with
1013
+ | Cpp | Hl | Jvm ->
1014
+ true
1015
+ | _ ->
1016
+ false
1017
+ in
1012
1018
let rec loop e = match e.eexpr with
1013
1019
| TBlock [e1] ->
1014
1020
loop e1
1015
1021
(* If there's a complex expression, keep the function and generate a call to it. *)
1016
- | TBlock _ | TIf _ | TSwitch _ | TTry _ when actx.com.platform = Cpp || actx.com.platform = Hl ->
1022
+ | TBlock _ | TIf _ | TSwitch _ | TTry _ when doesnt_like_complex_expressions ->
1017
1023
raise Exit
1018
1024
(* Remove generated return *)
1019
1025
| TReturn (Some e ) ->
Original file line number Diff line number Diff line change
1
+ package unit .issues ;
2
+
3
+ class Issue11998 extends unit. Test {
4
+ static var caughtVar = {
5
+ try {
6
+ throw " foo" ;
7
+ } catch (s : String ) {
8
+ s ;
9
+ }
10
+ }
11
+
12
+ public function test () {
13
+ eq (" foo" , caughtVar );
14
+ }
15
+ }
You can’t perform that action at this time.
0 commit comments