ID:2830750
 
BYOND Version:514
Operating System:Windows 10 Pro 64-bit
Web Browser:Firefox 106.0
Applies to:DM Language
Status: Open

Issue hasn't been assigned a status value.
Descriptive Problem Summary:
A proc argument starting with /var/ will create a global variable instead of an argument or an error.

Numbered Steps to Reproduce Problem:
1. Create a proc with an argument starting with /var/
2. Reference that argument outside of the proc/check if that var is present in `global`.
3. Observe that passing a value to the proc in that position does nothing.
4. See that the var isn't listed in the object tree.
Code Snippet (if applicable) to Reproduce Problem:
/proc/foo(/var/bar = 5)
return bar

/world/New()
world.log << bar // output: 5
world.log << global.bar // output: 5
world.log << global.vars["bar"] // output: 5
world.log << foo(3) // output: 5


Expected Results:
An error, like if you use a leading slash with no var. Barring that, to create an argument rather than a global variable that exists outside of the object tree but can still be accessed with the global keyword and shows up in global.vars.

Actual Results:
A global variable, which reportedly doesn't show up in the object tree but is otherwise a normal global variable despite being 'declared' in a proc's argument definition. I checked and can't find it in there, so maybe there's some truth to that.

Does the problem occur:
Every time? Or how often?
It is reliably reproduced in even small test cases.
In other games?
Yes.
In other user accounts?
Yes.
On other computers?
Yes.

When does the problem NOT occur?
When you don't use a leading slash with the var keyword in an proc argument definition.

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.)
I'm certain it occurred as early as 513, but it may have even been around back in 512 or earlier. I've received word others have seen it as far back as 511.

Workarounds:
Remove the leading slash.