ID:2856516
 
Resolved
The compiler wasn't throwing duplicate definition errors for duplicated var names.
BYOND Version:514.1589
Operating System:Windows 10 Home 64-bit
Web Browser:Chrome 110.0.0.0
Applies to:Dream Maker
Status: Resolved (515.1602)

This issue has been resolved.
Descriptive Problem Summary:

Under the below situation, in 514.1585, an error should be generated. In 515.1601 and 514.1589 (latest beta and stable), no error is generated, which is potentially dangerous.

Numbered Steps to Reproduce Problem:

Just compile the following code snippet, or modifications of such code snippet. Even if the variables in the snippet are used (and the warnings indicating that the variables are defined but not used aren't present) the error is not generated as expected.

Code Snippet (if applicable) to Reproduce Problem:
proc/DummyProc()
var/a = new /obj
var/a = 1
// Or...
var/b = new /obj
for(var/b in world)
world<<b


Expected Results:

As in 514.1585 and previous, this would output a "duplicate definition" error, pointing me to the duplicated definition as well as the previous definition.

Actual Results:

No error is generated and I'm able to run the project normally.

Does the problem occur:
Every time? Or how often? Yes.
In other games? Probably.
In other user accounts? Mhm.
On other computers? Cannot confirm.

When does the problem NOT occur?

If the original variable is not an atom or datum (i.e. a number or string or null), the error generates correctly. As an obj, mob, datum, atom, turf, etc. the error is not generated.

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.)

This issue did not occur in 514.1585.

Workarounds:

Don't be bad and declare duplicate variable definitions in the first darn place, normie.
Lummox JR resolved issue with message:
The compiler wasn't throwing duplicate definition errors for duplicated var names.
In response to LemonInTheDark
Kinda looks like it. If Lum doesn't do it himself in a day or so, I'm going to merge them.
Best to just close the other one as resolved. Merging when the closed issue is the newer one ends up kinda weird.