# \[BUG\] Multiline operator concatenation is being ignored

**URL:** <https://forums.unrealengine.com/t/bug-multiline-operator-concatenation-is-being-ignored/1162194>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, bug-report, fortnite\
**Created:** [May 11, 2023, 6:17am UTC](https://forums.unrealengine.com/t/bug-multiline-operator-concatenation-is-being-ignored/1162194 "2023-05-11T06:17:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Knight\_Breaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/knight_breaker/32/1194711_2.png) [@Knight\_Breaker](https://forums.unrealengine.com/u/Knight_Breaker)\
**Post date:** [May 11, 2023, 6:17am UTC](https://forums.unrealengine.com/t/bug-multiline-operator-concatenation-is-being-ignored/1162194/1 "2023-05-11T06:17:37Z")

</div>

I’m writing the code snippet from memory, so I apologize if it does not properly compile. As far as I remember I run multiple times into this odd issue. In my codebases I set a fixed line width of 100 characters and start wrapping code into next lines if it’s exceeded.  
In that sense if I have multiple arrays or string literals which I would like to merge, I start moving the `+` concatenation operation into next lines. However this seems to be swallowed by the compiler.

```auto
Func(): string = {
  Result := "first line"
    + "\nsecond line"
    + "\nthrid line"
    # etc.
  return Result
}

```

As far as I remember scenarios like this always resulted into only the first value being added to the result.

Workarounds:

```auto
Func(): string = {
  Result := "first line" + "\nsecond line" + "\nthrid line" # etc.
  return Result
}

Func(): string = {
  var Result: string = "first line" 
  set Result += "\nsecond line" 
  set Result += "\nthrid line" 
  # etc.
  return Result
}

```

The first workaround might not always be suitable as it could easily exceed the previously mentioned line width.  
This is a critical issue as it’s extremely easy to miss und totally unintuitive. Missing string parts is relatively harmless, but missing array elements can lead to unexpected program behavior and bugs.

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [May 14, 2023, 10:30pm UTC](https://forums.unrealengine.com/t/bug-multiline-operator-concatenation-is-being-ignored/1162194/2 "2023-05-14T22:30:23Z")

</div>

Yep it’s strange considering that it works with if statements :

```auto
RotationMultiplier := if(1 > 0)
                      then true
                      else false

```

Also, did you try putting the ‘+’ operator at the end of the line like this ?

```auto
Func(): string = {
  Result := "first line" +
    "\nsecond line" +
    "\nthrid line"
    # etc.
  return Result
}

```

---

<div class="post-metadata">

**Author:** ![Knight\_Breaker](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/knight_breaker/32/1194711_2.png) [@Knight\_Breaker](https://forums.unrealengine.com/u/Knight_Breaker)\
**Post date:** [May 25, 2023, 6:16am UTC](https://forums.unrealengine.com/t/bug-multiline-operator-concatenation-is-being-ignored/1162194/3 "2023-05-25T06:16:48Z")

</div>

No I have not tried it, it might actually work if my assumption about operator inference is correct.

I guess the compiler treats the `+` as prefix operators instead correctly indicting those as wrapped infix operators.

In general I would say that prefix or suffix operators should not permit whitespaces between them and their values while infix operators should at least prefer whitespaces for readability.

```auto
+ something # raise an error (prefix)
+something # okay (prefix)

a + b # infix (preferred)
a+b # infix 

a
+
b # okay but harder to read

some_long_name
  + something_else # okay (infix)

```

cc @Conan_Reis
