ID:2489271
 
BYOND Version:512
Operating System:Windows 7 Pro
Web Browser:Firefox 68.0
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
This code will compile
var/atom/A = new(loc)
A++


Byond will happily compile this, and then when you run it, your A will silently be replaced by a 1, and everything after that tries to treat this A as an atom will runtime.

To add insult to injury, we tried the following
//HERES A LITTLE LESSON IN TRICKERY
/datum/proc/operator+()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)

/datum/proc/operator-()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)


And it didn't even appear to affect what the ++ operator does at all

This is wildly confusing behavior, and it's all too easy to accidentally have a brain jam and do ++ on the wrong var and causes all sorts of hard to trace runtimes

At the very least, let us override the ++ and -- operators for datums so we can do what we want above.
Scrap that someone pointed me towards the release notes about the new help docs on overloading ++ and --

http://www.byond.com/docs/notes/512.html Additionally, the ++ and -- operator overloads were not properly documented.

Assuming these work like I expect I believe we can close this
so, new update, byond was not very happy with me overloading ++ and -- for datums

//HERES A LITTLE LESSON IN TRICKERY
/datum/proc/operator++()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)

/datum/proc/operator--()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)

/datum/proc/operator+()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)

/datum/proc/operator-()
        stack_trace("With this operators's use, the thread of prophecy is severed. Restore a saved code to restore the weave of fate, or persist in the doomed world you have created.")
        del(world)


Cue a bajillion runtimes
[11:21:59] Runtime in manifold4w.dm,25: BYOND Error: bad instruction: 8521
  proc name: SetInitDirections (/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections)
[11:21:59] Runtime in manifold4w.dm,25: BYOND Error: bad instruction: 8521
  proc name: SetInitDirections (/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections)
That code is
/obj/machinery/atmospherics/pipe/manifold4w/SetInitDirections()
        initialize_directions = initial(initialize_directions)
I'll try to work on a test case for this that's minimal tomorrow
scrap all of this, the issues were caused by 1474

I don't think I have any bugs at all