ID:2579500
 
Resolved
Adding constant numbers and strings at compile-time did not compile correctly, resulting in weird outcomes at runtime.
BYOND Version:513.1525
Operating System:Windows 10 Enterprise
Web Browser:Chrome 83.0.4103.61
Applies to:Dream Maker
Status: Resolved (513.1526)

This issue has been resolved.
Descriptive Problem Summary:
Incorrectly adding a number and a string in a const setting will produce a buggy output instead of erroring. In the snippet, `20 + "foo"` resolves to "foofoo", instead of being a compile error.

Numbered Steps to Reproduce Problem:
1. Run snippet.

Code Snippet (if applicable) to Reproduce Problem:
/world/New()
var/x = 20 + "foo"
world.log << x


Expected Results:
Compile error, cannot add number and string.

Actual Results:
Buggy string printed, "foofoo".

Does the problem occur:
Every time? Or how often? Every time
In other games? N/A
In other user accounts? N/A
On other computers? Yes, on Linux build.

When does the problem NOT occur?
N/A

Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
Unknown, has been happening for a few years at least. Occurs in stable 512.1488

Workarounds:
Doing this concat at runtime correctly causes a runtime error.
Another weird case:

/world/New()
var/x5 = "three" + "four" + 7
var/x6 = 7 + "three" + "four"
world.log << x5
world.log << x6


Output:

14
/world/Newthreefour
Lummox JR resolved issue with message:
Adding constant numbers and strings at compile-time did not compile correctly, resulting in weird outcomes at runtime.
Something similar seems to happen with division, as well. Is that also fixed?
All the other operators I saw someone try correctly errored. Only + and / caused weird behavior.
In response to Exxion
I didn't touch division; it would be a separate issue needing separate test cases.