StaticType identifier not found with nativized bp asset

Trying to compile in shipping mode with nativized bp assets on and get the following errors:

33>C:\Unreal Engine\Source\Source_13\Engine\Source\Runtime\CoreUObject\Public\UObject\Linker.h(2320): error C2039: 'StaticType': is not a member of 'ADoWWeapon_MachineGun'
33>  C:\Unreal Engine\DaysOfWar\Perforce\DaysOfWar_Workspace\Source\DaysOfWar/Classes/Weapons/BaseWeapons/DoWWeapon_MachineGun.h(31): note: see declaration of 'ADoWWeapon_MachineGun'
33>  C:\Unreal Engine\DaysOfWar\Perforce\DaysOfWar_Workspace\Intermediate\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Private\New_Player_Master_FP_AnimBP__pf4028999533.cpp(1759): note: see reference to function template instantiation 'T *Cast<ADoWWeapon_MachineGun>(FLinker *)' being compiled
33>          with
33>          [
33>              T=ADoWWeapon_MachineGun
33>          ]
33>C:\Unreal Engine\Source\Source_13\Engine\Source\Runtime\CoreUObject\Public\UObject\Linker.h(2320): error C3861: 'StaticType': identifier not found
33>C:\Unreal Engine\Source\Source_13\Engine\Source\Runtime\CoreUObject\Public\UObject\Linker.h(2320): error C2039: 'StaticType': is not a member of 'ADoWWeapon_Rocket'
33>  C:\Unreal Engine\DaysOfWar\Perforce\DaysOfWar_Workspace\Source\DaysOfWar/Classes/Weapons/BaseWeapons/DoWWeapon_Rocket.h(32): note: see declaration of 'ADoWWeapon_Rocket'
33>  C:\Unreal Engine\DaysOfWar\Perforce\DaysOfWar_Workspace\Intermediate\WindowsNoEditor\NativizedAssets\Source\NativizedAssets\Private\New_Player_Master_FP_AnimBP__pf4028999533.cpp(1771): note: see reference to function template instantiation 'T *Cast<ADoWWeapon_Rocket>(FLinker *)' being compiled
33>          with
33>          [
33>              T=ADoWWeapon_Rocket
33>          ]

The offending lines are:

b0l__K2Node_DynamicCast_AsDo_WWeapon_Machine_Gun__pf = Cast<ADoWWeapon_MachineGun>(nullptr);

and

b0l__K2Node_DynamicCast_AsDo_WWeapon_Rocket__pf = Cast<ADoWWeapon_Rocket>(nullptr);

It seems odd that the Cast<>() macro would be calling the one in Linker.h? Idk, maybe it’s intentional.

Both classes (The DoW ones) are defined with UCLASS() (with no specifiers.) I tried adding BlueprintType to them. Didn’t work.

Looking at the blueprint itself, the inputs to these functions are not connected. The nullptr in the generated class is making the compiler use the wrong Cast function. Dodgy!

So yeah, it’s because of the nullptr causing the wrong Cast function to be called. Fixed!