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