Skip to content
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

Hidden methods in C++ #268

Closed
tamasborbas opened this issue Aug 19, 2015 · 4 comments
Closed

Hidden methods in C++ #268

tamasborbas opened this issue Aug 19, 2015 · 4 comments

Comments

@tamasborbas
Copy link
Member

Problem

There is a super class and a sub class. In both there is one-one method with the same name but with different parameters. In C++ the inherited method is hidden by the sub class's method with the same name and super class's method cannot be called in a simple way.

image

Cannot be built:

B* b = new B();
b->a();

Possible solutions

  • Preferred
B* b = new B();
((A*)b)->a();
  • Others
B* b = new B();
b->A::a();
B* b = new B();
A* _temp_b = b
_temp_b->a();
Class B: public A
{
...
using A::a;
...
}

B* b = new B();
b->a();
@g2k2c8
Copy link
Contributor

g2k2c8 commented Sep 2, 2015

We need to support this feature

@g2k2c8
Copy link
Contributor

g2k2c8 commented Sep 2, 2015

Should support this version
B* b = new B();
b->A::a();

@abelhegedus
Copy link
Member

Initial support is added in #352
The operation FQN is used if the class that defines the operation has a subtype (transitively) that defines an operation with the same name.

@abelhegedus
Copy link
Member

Fixed in master, further enhancements or erroneous cases should be reported in new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants