Jump to content
  • Advertisement
Sign in to follow this  
huangyous

Bug in 2.161:derive class call wrong base method

This topic is 3417 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

there are 4 classes,When C3 calls "Fun()",I think it should call C2::Fun,but it prints "C1:Fun" in this case; When I comment the "void dumy(){}" line,it prints "C2::Fun",So I think maybe its a bug. class C0 { void dumy(){}//comment this line to make the "Fun()" call right }; class C1:C0 { void Fun() { print("C1:Fun"); } }; class C2:C1 { void Fun() { print("C2:Fun"); } }; class C3:C2 { void call(){Fun();} }; C3 c3();c3.call();

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!