wdl
wdl copied to clipboard
Clarify access to a non-existent `Object` member
Currently the spec does not state whether accessing an object member that does not exist results in a None or an error. E.g.
Object foo = object { a: 1 }
Int b = foo.b # what happens here??
I suggest that the result should be a None, since there is currently no way to check the existence of an Object member.
I suggest an error.
input:
my_optional_string=foo.b
Should throw an error when b does not exist, rather than silently putting in a None.
That's a good point - I would expect an error in that case.
Maybe we can have contains_key() (#305 ) accept either a Map or Object?
I am in favour of an error as well with a preference for using the contains_key function. Most languages raise some sort of access error when you are trying to do a direct access and the key does not exist