Cpp-Swift Interop fails when inheriting from NSObject

I have a project where I m making direct swift calls from cpp as introduced in swift5.9. Below is my swift class whose method is being invoked on cpp.

import Foundation

public class MySwiftClass
public static func testInterop () -> Void
NSLog("----------- hey --------")

I m able to successfully invoke 'testInterop()' in cpp with the above class, however if I add inhertance to NSObject in the 'MySwiftClass' class, then the swift call in the below cpp code fails with the error "No member named 'MySwiftClass' in namespace 'CoreModule'", where CoreModule is my swift target. Below is my Cpp code to invoke swift method:

#include "temp.hpp"
#include "CoreModule-Swift.h"

TempLogger::DisplayTempError ()
CoreModule::MySwiftClass::testInterop ();

I m not able to identify why is inheriting from NSObject generating this error?

If I had to guess I would say once you inherit from NSObject you'll get an Objective-C class as a result, not a C++ one. And if that's the case then you'll need to use Objective-C++ (with a .mm file) to use this Objective-C class. (And it also won't be namespaced because it's Objective-C.)

But I'm just guessing here. I don't have experience with C++ interop and I could be wrong.