/Engine/Source/Runtime/Core/Public/Templates/UnrealTypeTraits.h
Test the derived type pointer. If it inherits from BaseType, theTest( BaseType* )will be chosen. If it does not, Test( ... ) will be chosen.
static constexpr bool Value = sizeof(Test( DerivedTypePtr() )) == sizeof(Yes);