Explorar o código

fix bug in string concatenation

frabbit %!s(int64=11) %!d(string=hai) anos
pai
achega
85c7a4e55b
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      genpy.ml

+ 1 - 1
genpy.ml

@@ -1174,7 +1174,7 @@ module Printer = struct
 				in
 				let rec safe_string ex =
 					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
 						| _,x when (is_type1 "" "String")(x) -> Printf.sprintf "HxOverrides.stringOrNull(%s)" (print_expr pctx ex)
 						| _,_ -> Printf.sprintf "Std.string(%s)" (print_expr pctx ex)