From 46ded5a17d4cf33b28be4d5fb0486a4f07b64db7 Mon Sep 17 00:00:00 2001 From: Simon Krajewski Date: Tue, 7 Nov 2023 14:27:26 +0100 Subject: [PATCH] Dont infer string on concat (#11318) * [typer] don't infer String when concatenating see #11284 * dodge neko things very elegantly --- src/typing/operators.ml | 6 ++---- std/neko/Boot.hx | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/typing/operators.ml b/src/typing/operators.ml index 3c9d92f035d..94a43d08bec 100644 --- a/src/typing/operators.ml +++ b/src/typing/operators.ml @@ -239,14 +239,12 @@ let make_binop ctx op e1 e2 is_assign_op with_type p = if unify_int ctx e1 KUnk then tint else tfloat | KUnk , KFloat | KUnk , KString -> - unify ctx e1.etype e2.etype e1.epos; - e1.etype + e2.etype | KInt , KUnk -> if unify_int ctx e2 KUnk then tint else tfloat | KFloat , KUnk | KString , KUnk -> - unify ctx e2.etype e1.etype e2.epos; - e2.etype + e1.etype | _ , KString | KString , _ -> tstring diff --git a/std/neko/Boot.hx b/std/neko/Boot.hx index 19ff40aa0b4..05b8ffa6bd7 100644 --- a/std/neko/Boot.hx +++ b/std/neko/Boot.hx @@ -48,7 +48,7 @@ class Boot { i += 1; } e.__string = old; - return s + untyped ")".__s; + return NativeString.ofString(s + untyped ")".__s); } private static function __interfLoop(cc:Dynamic, cl:Dynamic) {