What I think is going on: the default constructor sets the value of the TUnion’s private member CurrentSubtypeIndex to -1; this value is later used in a switch case inside the copy constructor. However CurrentSubtypeIndex is unsigned, of type uint8, and due to integer promotion the switch case compares int32(-1), ie 0xFFFFFFFF with uint8(-1), ie 0xFF. The comparison fails and the default case triggers, which is a UE_LOG() with a Fatal log level, thus crashing the editor.
Is there anything else you’re including in your project when doing this? When attempting to compile a project with the two lines you provided, it will fail with a link error if the second line is present. To give you the exact error in case it may help:
Thank you for the report and for that clarification. I’m seeing the same issue so I’ve placed a bug report in for the issue. For reference, the number is UE-28427. I’ll be sure to let you know if any changes are made and keep you up to date.