unique_ptr::reset() calls the destructor and bang, you're dead, because its internal members are most probably crap.
If you alias an ArrayInfo over the same bytes as ObjectInfo, it can't end well.
unique_ptr and int size is implementation defined, your String is who knows what (pointer + int or an int + pointer or possibly anything). How do you imagine it should work? What are you trying to achieve? The unique_ptr won't be in a healthy state for you to call reset.
Furthermore, the standard says it's only legal to read from the most recently written union member, although actual compilers are less strict.
What you suggest might work, just I wouldn't call a "String" dtor on an instance of a ObjectInfo class
But what's the point?