Description

The TUnion copy constructor causes the editor to toss an assert due to it claiming that the passed in TUnion is of an Unrecognized TUnion subtype.

Steps to Reproduce
  1. Create a new code project and add a new C++ class based off Actor named MyActor
  2. On line #5 of MyActor.cpp, add the following include:
     #include "Runtime/Core/Public/Containers/Union.h" 
  3. On line #6 of MyActor.cpp, add the following define (Needed due to [Link Removed])
     DEFINE_LOG_CATEGORY(LogUnion); 
  4. On line #21 (Or the line after the Super for BeginPlay) add the following lines:
     TUnion<int32, float> default_constructed;
    	TUnion<int32, float> copy_constructed = default_constructed; 
  5. Compile and return to the editor (ensure that Hot Reload occurred, if it did not, restart the editor.)
  6. Add an instance of MyActor to the level and press Play for PIE
    Result: The editor asserts with the callstack below.
    Expected: The editor should be able to handle the copy constructor.
Callstack
 Unknown exception - code 00000001 (first/second chance not available)

"Fatal error: [File:C:\Program Files\Epic Games\4.10\Engine\Source\Runtime//Core//Public//Containers//Union.h] [Line: 374] 
Unrecognized TUnion subtype
"

UE4Editor_Core!FDebug::AssertFailed() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\core\private\misc\outputdevice.cpp:374]
UE4Editor_MyProject4!TUnion<int,float,FNull,FNull,FNull,FNull>::FatalErrorUndefinedSubtype() [c:\program files\epic games\4.10\engine\source\runtime\core\public\containers\union.h:374]
UE4Editor_MyProject4!AMyActor::BeginPlay() [c:\users\matthew.clark\documents\unreal projects\4.10\myproject4\source\myproject4\myactor.cpp:21]
UE4Editor_Engine!AWorldSettings::NotifyBeginPlay() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\worldsettings.cpp:137]
UE4Editor_Engine!AGameMode::HandleMatchHasStarted() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\gamemode.cpp:614]
UE4Editor_Engine!AGameMode::SetMatchState() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\gamemode.cpp:730]
UE4Editor_Engine!AGameMode::StartMatch() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\gamemode.cpp:591]
UE4Editor_Engine!UWorld::BeginPlay() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\world.cpp:3082]
UE4Editor_Engine!UGameInstance::StartPIEGameInstance() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\engine\private\gameinstance.cpp:274]
UE4Editor_UnrealEd!UEditorEngine::CreatePIEGameInstance() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\editor\unrealed\private\playlevel.cpp:3012]
UE4Editor_UnrealEd!UEditorEngine::PlayInEditor() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\editor\unrealed\private\playlevel.cpp:2259]
UE4Editor_UnrealEd!UEditorEngine::StartQueuedPlayMapRequest() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\editor\unrealed\private\playlevel.cpp:1048]
UE4Editor_UnrealEd!UEditorEngine::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\editor\unrealed\private\editorengine.cpp:1244]
UE4Editor_UnrealEd!UUnrealEdEngine::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\editor\unrealed\private\unrealedengine.cpp:361]
UE4Editor!FEngineLoop::Tick() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launchengineloop.cpp:2427]
UE4Editor!GuardedMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\launch.cpp:142]
UE4Editor!GuardedMainWrapper() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:126]
UE4Editor!WinMain() [d:\buildfarm\buildmachine_++depot+ue4-releases+4.10\engine\source\runtime\launch\private\windows\launchwindows.cpp:200]
UE4Editor!__scrt_common_main_seh() [f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:264]
kernel32
ntdll

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Fixed
ComponentUE - Foundation - Core
Affects Versions4.9.24.10.44.114.12
Target Fix4.12
Fix Commit2914914
Main Commit2921423
CreatedMar 15, 2016
ResolvedMar 18, 2016
UpdatedFeb 5, 2017