I was trying to write an interop test, and got sidetracked trying to get even the simplest bit of inheritance working. I figured I must be doing something wrong..
my header:
class Foo {
public:
Foo() { }
virtual int Hello() { return 4; }
};
class Bar : public Foo {
public:
Bar() { }
virtual int Hello() { return 5; }
};
And my swift test:
MyTestSuite.test("do something") {
var b = Bar();
print(b.Hello())
}
Results in an error about it being ambiguous:
error: ambiguous use of 'Hello()'
print(b.Hello())
^
Polymorphism.Bar:3:26: note: found this candidate
public mutating func Hello() -> Int32
^
<unknown>:0: note: found this candidate
This is with ToT updated Dec 12 2022 or so.
I know it's got to be obvious...
-pink