ID:2798257
 
Resolved
Attempting to access an invalid var for lists at runtime will now throw an error, whereas in the past it failed silently. This applies only to worlds compiled in version 515 or later.
BYOND Version:514
Operating System:N/A
Web Browser:N/A
Applies to:Dream Daemon
Status: Resolved (515.1590)

This issue has been resolved.
Descriptive Problem Summary:
Attempting to read a var that is not defined on /list should throw a runtime error, instead reading returns null.
Numbered Steps to Reproduce Problem:
Run this project: https://github.com/DamianX/byondbugs/raw/main/listvars/ listvars.zip
Code Snippet (if applicable) to Reproduce Problem:
/world/New()
..()
var/obj/L = list() // Defined as obj so that accessing /obj vars can compile, but should fail at runtime.
world.log << isnull(L.icon) // Outputs 1, should throw instead

var/list/L2 = list()
world.log << isnull(L2:icon_state) // Outputs 1, should throw instead.


Expected Results:
Runtime errors.
Actual Results:
Nothing at all.
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?
Don't know.
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.)
Don't know.
Lummox JR resolved issue
This behavior will change for .dmb files compiled in version 515 or higher.
Lummox JR resolved issue with message:
Attempting to access an invalid var for lists at runtime will now throw an error, whereas in the past it failed silently. This applies only to worlds compiled in version 515 or later.
Will this still allow us to do something like list["new key"]="something" without returning an error?
In response to Zagros5000
Yeah, that's not a var. That's just regular associative list behavior.

This issue involves doing something like so:

var/thing = list()
usr << thing:opacity

In the past that failed silently, but now it will produce a runtime error like it should.