ID:2657148
 
Resolved
The ?. operator when used on the left-hand-side and before a list index, e.g. a?.b[c] = d, did not compile correctly.
BYOND Version:513
Operating System:Windows 10 Enterprise 64-bit
Web Browser:Chrome 88.0.4324.182
Applies to:Dream Maker
Status: Resolved (514.1548)

This issue has been resolved.
Descriptive Problem Summary:
?. operator throws runtime errors where it should work without any issues

Numbered Steps to Reproduce Problem:
1)Download and run test case https://drive.google.com/file/d/ 1eTyDaxlP0K6sgP-OC0qICbOyzSZS4ftO/view?usp=sharing
2)Press "do a bug" verb
3)Enjoy your runtime errors

Code Snippet (if applicable) to Reproduce Problem:
/client
var/list/random_list = list()

/mob/verb/do_a_bug()
client?.random_list["[rand(1, 999999)]"] = list(world.time) //throws a runtime error "bad index"

//client.random_list["[rand(1, 999999)]"] = list("[rand(1, 999999)]") //works well
//client?.random_list["[rand(1, 999999)]"] = list("[rand(1, 999999)]") //works well
//client?.random_list["[rand(1, 999999)]"] = list(src.layer) //throws a runtime error "undefined variable /mob/var/random_list"


Expected Results:
No runtime errors

Actual Results:
Different runtime errors

Does the problem occur:
Every time? Or how often?
Every time
In other games?
Yes
In other user accounts?
Yes
On other computers?
Yes

When does the problem NOT occur?
When you don't use ?. operator

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 don't know

Workarounds:
Don't use ?. operator, use .

Lummox JR resolved issue with message:
The ?. operator when used on the left-hand-side and before a list index, e.g. a?.b[c] = d, did not compile correctly.