-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
a C++ derived class that defines an operator hides automatic base class conversion #65
Comments
workaround: skip generating Calypso/ddmd/cpp/calypso.cpp:
NOTE: I had intially tried in Calypso/ddmd/expression.d A better workaround would be to generate |
still a better workaround (requiring no change in Calypso/ddmd/cpp/calypso.cpp, hence not suppressing generation of Calypso/ddmd/expression.d in
|
improved version that only gags when both e1.type and to are C++ classes from langPlugin:
|
…ble overloading by opCast when a CastExp is a downcast to a C++ base. In D code an explicit cast gets overloaded if there's a member named opCast even if opCast!BaseClass isn't valid.
…ble overloading by opCast when a CastExp is a downcast to a C++ base. In D code an explicit cast gets overloaded if there's a member named opCast even if opCast!BaseClass isn't valid.
…) Disable overloading by opCast when a CastExp is a downcast to a C++ base." This reverts commit ea850ce.
…t to a C++ base. In D code an explicit cast gets overloaded if there's a member named opCast even if opCast!BaseClass isn't valid. Thanks to @timotheecour for the original fix in PR #95.
Fixed by c3573b9. |
@Syniurge : a C++ derived class that defines an operator hides automatic base class conversion
test.h:
main.d:
compiling produces this error:
Error: template instance opCast!(A) does not match template declaration opCast(type : float)
The error goes away if we remove
operator float() const;
It works if we add
operator A*() {return this;}
inB
and change the D code to:int bx=(cast(A*)b).x;
but this is obviously not practical.The text was updated successfully, but these errors were encountered: