Skip to content

Commit

Permalink
Dont infer string on concat (#11318)
Browse files Browse the repository at this point in the history
* [typer] don't infer String when concatenating

see #11284

* dodge neko things very elegantly
  • Loading branch information
Simn authored Nov 7, 2023
1 parent 01dde74 commit 46ded5a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/typing/operators.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion std/neko/Boot.hx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 46ded5a

Please sign in to comment.