hasField wrongly returns false if the field is inherited