I have been having issues packaging a project with Nativization set to Inclusive. The issue seems to be in passing a delegate to a function.
Steps to reproduce (tested in 4.20.3, still present in 4.22.2):
- Create empty project (code or blueprint)
- Create an Actor
- In the Actor, create an event dispatcher and a function that calls “Bind Event to DispatcherName”. Drag the event pin to the function input node to create a delegate-type input variable.
- In the Actor, call the function on BeginPlay. Connect a CustomEvent to the dispatcher pin.
- Place actor in map, add map to list of maps to package, set Nativization to Inclusive. Compile and package.
This results in the following log: Unreal cook log (nativization dispatcher variable bug) - Pastebin.com
The relevant part of the log being lines 626 - 628. So, it boils down to
Reason: cannot convert from 'ATestActor_C__pf1010915279::FTestComponentDispatcher__pf__TestComponent_C__pf__SinglecastDelegate' to 'const UTestComponent_C__pf1010915279::FTestComponentDispatcher__pf__TestComponent_C__pf__SinglecastDelegate'
The generated CPP file cannot convert the SinglecastDelegate to const SinglecastDelegate. The project packages fine without nativization and functions as intended, so this is clearly a natvization bug. Please let me know if there is a fix.