UProperty is correct, FProperty is wrong?

I need to make a struct to TArray<uint8> conversion, I declared the API


UFUNCTION(BlueprintCallable, CustomThunk, meta = (CustomStructureParam = "AnyStruct"))
static TArray<uint8> StructToData(UProperty* AnyStruct);

but in the higher version UProperty is renamed to FProperty, I modified the API to


UFUNCTION(BlueprintCallable,CustomThunk, meta = (CustomStructureParam = "AnyStruct"))
static TArray<uint8> StructToData(FProperty* AnyStruct);

Get error:Unrecognized type ‘FProperty’ - type must be a UCLASS, USTRUCT or UENUM

When using CustomStructureParam / CustomThunk, the type you pass in can actually be anything at all. I use an int32 to pass in struct data here. No matter what input type you use, any pin will connect to it (even exec pins).



UFUNCTION(BlueprintCallable, CustomThunk, meta = (CustomStructureParam = "Data"))
void SomeFunction(const int32& Data);


To enforce some degree of type-safety for the input, you can throw blueprint exceptions during the CustomThunk body if the input doesn’t meet your expectations:



DEFINE_FUNCTION(UMyType::execSomeFunction)
{
Stack.Step(Stack.Object, nullptr);

const FStructProperty* StructProperty = CastField<FStructProperty>(Stack.MostRecentProperty);
const void* StructData = Stack.MostRecentPropertyAddress;

P_FINISH;

// Must have a valid input property
if (!StructProperty || !StructData)
{
FBlueprintExceptionInfo ExceptionInfo(
EBlueprintExceptionType::AccessViolation,
FText::FromString("Input data must be a Struct.")
);

FBlueprintCoreDelegates::ThrowScriptException(P_THIS, Stack, ExceptionInfo);
}
else
{
// etc...
}
}


Your example is not clear. Where should code below be placed, what is UMyType and execSomeFunction, etc… Your code didn’t compile for me.