Description
If you miss adding the impl Constructor for ...
shim trait impl in the bridge, but implement the trait outside the bridge, you don't get a warning, CXX-Qt will just skip using your constructor.
This is especially bad in combination with cxx_qt::Initialize
, as that requires you to declare a default constructor, which you also get if you don't add the declaration, but the one generated by CXX-Qt won't actually call your initialize
function.
Idea to remedy this
We could introduce a new trait: ConstructorDeclaration<()>
(name TBD), where Constructor
requires ConstructorDeclaration
.
And ConstructorDeclaration would only be implemented by the bridge if you add impl Constructor<()> for ... {}
.
That way you would get a compiler error if you implement the Constructor or Initialize trait without declaring it in the bridge.