ID:2529906
 
Resolved
Attempting to access a var that is ordinarily a built-in object proc, such as Copy, resulted in broken compiled code that could crash the server.
BYOND Version:512
Operating System:Windows 10 Home
Web Browser:Firefox 71.0
Applies to:Dream Maker
Status: Resolved (513.1504)

This issue has been resolved.
Descriptive Problem Summary:
Using the : operator in certain situations (see code below) can confuse the compiler into thinking a method name is actually a variable name. When this code is executed, it will cause a hard crash as DS tries to access the method as if it were a variable.

Code Snippet (if applicable) to Reproduce Problem:
mob/Login()
..()
var/list/L = list(list(1, 2, 3))
L[1]:Copy // Note the lack of parentheses, as opposed to it being L[1]:Copy()


Expected Results:
Shouldn't compile, because Copy is not a variable

Actual Results:
Causes a hard crash
Other examples include
var/x = world:Copy
1:Cut

Basically every time you attempt to access a method like you'd access a variable, with a colon, and the method name is defined for some other type.
I'll look into this and find out what's going on. It should never cause a hard crash.

The compiler of course can't prevent this, because it simply has no way to know for sure that something is never used as a var name but only as a proc. Trying to make the compiler aware of the distinction would be extremely difficult.

[edit]
I see what you mean about this being a compiler issue though. Seems the compiler is really confused here and is not actually compiling L[1]:Copy as a var access.
Lummox JR resolved issue with message:
Attempting to access a var that is ordinarily a built-in object proc, such as Copy, resulted in broken compiled code that could crash the server.