discoverType should return error if object is not of kind struct.