UHT can't parse default TSubclassOf<> function parameter

I’ve run into this issue with UHT before and had workarounds.

Like if I have an integeter parameter, UHT can’t parse constants.

#define THIS_WONT_WORK 5

// This won't compile
UFUNCTION(BlueprintCallable, Category = "Thing")
void MyFunc(int32 MyNumber = THIS_WONT_WORK)

// This compiles
UFUNCTION(BlueprintCallable, Category = "Thing")
void MyFunc(int32 MyNumber = 5 /*THIS_WONT_WORK*/)

I’ve hit a wall trying to make a default parameter for TSubclassOf. There seems to be no way to make UHT parse these. The C++ compiler itself is just fine if it’s a pure C++ function without a UFUNCTION specifier.

UFUNCTION(BlueprintCallable, Category = "Thing")
void MyFunc(TSubclassOf<ACharacter> CharacterClass = ACharacter::StaticClass());

UFUNCTION(BlueprintCallable, Category = "Thing")
void MyFunc(TSubclassOf<ACharacter> CharacterClass = TSubclassOf<ACharacter>());

The only solution that I have working is passing nullptr as the default, and I have to add documentation saying, if you provide null, it’ll default to a specific class.

/**
 * @param CharacterClass If you provide a null class, it'll default to ACharacter
 */
UFUNCTION(BlueprintCallable, Category = "Thing")
void MyFunc(TSubclassOf<ACharacter> CharacterClass = nullptr);