Can't place UInterface and it's implementation class in one header?

I’m now meet a problem:

UINTERFACE(MinimalAPI,BlueprintType, meta = (CannotImplementInterfaceInBlueprint))
class UTestInterface : public UInterface
{
	GENERATED_BODY()
};

class TEST_API ITestInterface
{
	GENERATED_BODY()
};

UCLASS(NotBlueprintable, NotBlueprintType)
class TEST_API UTestInterfaceImpl : public UObject, public ITestInterface
{
GENERATED_BODY()
}

I place UTestInterface,UTestInterface and UTestInterfaceImpl in one header, and the UHT says:“error : Class ‘UTestInterface’ contains a dependency (#include or base class) to itself”,After I move UTestInterfaceImpl to another file,there have no error anymore.
At first, I think it is because UBT doesn’t allow to do this, but I find UHT allow the user to place multiple UCLASS declarations in one header.
So I’m confused. Why Multiple UClass is OK, but UInterface can’t do the same thing?

This has nothing to do for number of classes in file, it depency issue as error suggests, what are includes you making?

Nothing Special:
TestA.h:
#include “CoreMinimal.h”
#include “Interface.h”
#include “TestB.h”
#include “SubclassOf.h”
#include “TestA.generated.h”

TestB:
#include “CoreMinimal.h”
#include “UObject/Object.h”
#include “Classes/BlueprintJsonLibrary.h” //It’s a plugin’s header
#include “TestB.generated.h”

BlueprintJsonLibrary.h:
#include “CoreMinimal.h”
#include “Kismet/BlueprintFunctionLibrary.h”
#include “BlueprintJsonLibrary.generated.h”

error : Class ‘TestA’ contains a dependency (#include or base class) to itself

After I Move the declaration of TestAImpl to TestAImpl.h,It successfully compiled, I don’t even change any include in TestA.h(TestAImpl.h include TestA.h)

I need to use it in Blueprint,that is why I use UIneterface.

Hi Jack,

The error seems to go away for me if I delete UTestInterface. Do you need to interact with the interface from Blueprint, or are your implementations of the interface only for use by C++ (as in the case of UTestInterfaceImpl)?

Hi Jack,

I looked internally, and this bug has already been reported and is currently assigned to a developer. In the meantime, it seems like the only workaround is to split up the interface and the class that implements it.

I‘m glad to hear that. Thanks.