In 4.19, it is no longer possible to create a non-static custom thunk in a class. This was possible in 4.18.3.


Steps to Reproduce
  1. Create a new Basic Code project.
  2. Add a new UActorComponent code class to the project.
  3. In the header file for the new UActorComponent class, add the following code:
    UPROPERTY(EditAnywhere, BlueprintReadWrite)
    TArray<FString> LineBuffer;
    UFUNCTION(BlueprintCallable, CustomThunk, Category = TestCat, meta = (CustomStructureParam = "AnyStruct"))
    void InitializeStruct(UProperty* AnyStruct);
    	LineBuffer.Add(TEXT("This is a test."));
  4. Build the project in Visual Studio.

The build fails with the following error: error C2228: left of '.Add' must have class/struct/union

The build completes successfully.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-58772 in the post.

Login to Vote

By Design
CreatedMay 7, 2018
ResolvedMay 8, 2018
UpdatedJul 14, 2021