How to access named array in namespace
octarect opened this issue · comments
Ryota Kota commented
Example:
def foo(obj) {
puts(obj.id) # ok
}
namespace Test {
def foo(obj) {
puts(obj.id) # error
}
}
obj = new Test [id: 1]
obj.foo
To access fields in named array, you can use dot notation like: obj.id. However, I got an error "function not found" when I used the notation in the context of namespace.
In this case, I think I must use another notation like below;
puts(obj("id"))
Is there anything else I can write? I think it is good to use the same notation even in namespace.
Yukihiro "Matz" Matsumoto commented
It must be a bug. I will investigate later.