I think you should just tests if the object implements []= operator. You can do this by creating a an interface

if (obj is Setter) 
  obj[name] = value;
if (obj is Getter)
  obj[name]
else
  reflection

class Setter {
  operator[]=(name, value){};
}

class Getter {
  operator[](name){};
}