FBlackboardKeySelector AddClassFilter does not work as promised

FBlackboardKeySelector::AddClassFilter as I could figure should add a class filter to blackboard key that filters by base class passed as AllowedClass parameter.

But AllowedClass is of type TSubclassOf< UClass > and there are no heirs of UClass class, and when you assign
UGameplayAbility::StaticClass to AllowedClass, then on conversion back to UClass* inside the function it becomes nullptr.
Shouldn’t AllowedClass be of type TSubClassOf< UObject > to properly allow filtering blackboard keys by class same as AddObjectFilter?

In fact if i manually do as follows:
FName PropertyName = GET_MEMBER_NAME_CHECKED(UBTTask_UseGameplayAbility, BlackboardKey);
const FName FilterName = MakeUniqueObjectName(this, UBlackboardKeyType_Class::StaticClass(), *FString::Printf(TEXT("%s_Class"), PropertyName.ToString()));
UBlackboardKeyType_Class
FilterOb = NewObject<UBlackboardKeyType_Class>(this, FilterName);
FilterOb->BaseClass = UGameplayAbility::StaticClass();
DesiredAbilityKey.AllowedTypes.Add(FilterOb);

and then try to edit behavior tree I’m allowed to select a Key of Class Type that has a base class of UGameplayAbility

I can confirm that AddClassFilter doesn’t work as expected.

There are two solutions to this.

You can just use AddObjectFilter as it effectively does the same thing; in fact I have no idea why there is a need for two versions.

Or if you fancy changing some code anyway you need to change AddClassFilter in BehaviorTreeTypes to:

void AddClassFilter(UObject* Owner, FName PropertyName, UClass* AllowedClass);