When a cpp class is used from swift, and is conformed to a protocol defining a static func, it will fail.
Reproduction
I have a class in cpp:
class Test {
public:
static void hellostatic() {
printf("hello from hellostatic\n");
};
void hello() {
printf("hello from cpp\n");
};
Test() = default;
Test(Test &other) = default;
~Test() = default;
};
I can call both the hello() func and hellostatic() funcs from swift:
var t = Test()
t.hello()
Test.hellostatic()
But if I create a protocol in swift, and conform the cpp object to it with an extension, the compilation will fail.
protocol Friendly {
mutating func hello()
// static func hellostatic() <- uncommenting this will cause compilation to fail
}
extension Test: Friendly {}
var t = Test()
t.hello()
Test.hellostatic()
Description
When a cpp class is used from swift, and is conformed to a protocol defining a static func, it will fail.
Reproduction
I have a class in cpp:
I can call both the hello() func and hellostatic() funcs from swift:
But if I create a protocol in swift, and conform the cpp object to it with an extension, the compilation will fail.
Stack dump
Expected behavior
compiles
Environment
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4) Target: arm64-apple-macosx15.0
Additional information
No response