Browse Source

fix bug in string concatenation

frabbit 11 years ago
parent
commit
85c7a4e55b
1 changed files with 1 additions and 1 deletions
  1. 1 1
      genpy.ml

+ 1 - 1
genpy.ml

@@ -1174,7 +1174,7 @@ module Printer = struct
 				in
 				in
 				let rec safe_string ex =
 				let rec safe_string ex =
 					match ex.eexpr, ex.etype with
 					match ex.eexpr, ex.etype with
-						| TBinop(OpAdd, e1, e2), _ -> Printf.sprintf "(%s + %s)" (safe_string e1) (safe_string e2)
+						| TBinop(OpAdd, e1, e2), x when (is_type1 "" "String")(x) -> Printf.sprintf "(%s + %s)" (safe_string e1) (safe_string e2)
 						| e, _ when is_safe_string ex -> print_expr pctx ex
 						| e, _ when is_safe_string ex -> print_expr pctx ex
 						| _,x when (is_type1 "" "String")(x) -> Printf.sprintf "HxOverrides.stringOrNull(%s)" (print_expr pctx ex)
 						| _,x when (is_type1 "" "String")(x) -> Printf.sprintf "HxOverrides.stringOrNull(%s)" (print_expr pctx ex)
 						| _,_ -> Printf.sprintf "Std.string(%s)" (print_expr pctx ex)
 						| _,_ -> Printf.sprintf "Std.string(%s)" (print_expr pctx ex)