Description

Repro Rate: 3/3

This issue occurs in the live build //UE5/Release-5.1 at CL 23058290.

This issue has also been regression tested against //UE5/Release-5.0 at CL 20979098 and is confirmed to be a regression since the issue did not occur in this build.

Customer comments:

This is a problem only with the new C# based UHT that comes with 5.1. This is code that has compiled fine since UE4.Disabling the new UHT using this made my code compile again.
<Configuration xmlns="https://www.unrealengine.com/BuildConfiguration">
<UEBuildConfiguration>
<bUseBuiltInUnrealHeaderTool>false</bUseBuiltInUnrealHeaderTool>
</UEBuildConfiguration>
</Configuration>
Steps to Reproduce

Steps:

  1. Create a C++ project.
  2. Create a new C++ Object class and name it ClassA.
    • This can be done by going to Tools > New C++ Class.
    • Click on All Classes button to show all the classes.
    • Select Object then click Next.
    • Change the name to ClassA then click Create Class.
  3. In Visual Studio, go to the newly created ClassA.h header file and change it to the following code:
#pragma once
#include "ClassA.generated.h"
UCLASS(BlueprintType, Blueprintable)
class BLANK_API UClassA : public UObject
{
    GENERATED_BODY()
public:
    DECLARE_DYNAMIC_MULTICAST_DELEGATE(FSomeDelegate);
};
  1. Repeat Step 2 but name the new C++ Object Class ClassB.
  2. In Visual Studio, go to the newly created ClassB.h header file and change it to the following code:
#pragma once
#include "ClassA.h"
#include "ClassB.generated.h"
UCLASS(BlueprintType, Blueprintable)
class BLANK_API UClassB : public UObject
{
    GENERATED_BODY()
public:
    UPROPERTY(BlueprintAssignable, Category = "Listeners")
        UClassA::FSomeDelegate OnDelegate;
};
  1. Compile the project.

Actual Result: The compiler fails with the following error:

Error: Unable to find 'class', 'delegate', 'enum', or 'struct' with name 'UClassA::FSomeDelegate'

Expected Result:The code should compile.

Have Comments or More Details?

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

2
Login to Vote

Fixed
Fix Commit23590032
Main Commit23580307
Release Commit23590032
CreatedDec 14, 2022
ResolvedJan 5, 2023
UpdatedFeb 4, 2023
View Jira Issue