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

Overloaded base function isn't called #1433

Open
deadlocklogic opened this issue Dec 21, 2022 · 1 comment
Open

Overloaded base function isn't called #1433

deadlocklogic opened this issue Dec 21, 2022 · 1 comment

Comments

@deadlocklogic
Copy link
Contributor

struct Test1 {
    void test() {
    }
};
struct Test2 : Test1 {
    void test(int value) {
    }
};
Test2.new():test()
Test2.new():test(2) # error stack index 2, expected number, received no value: not a numeric type that fits exactly an integer (number maybe has significant decimals) (bad argument into 'void(int)')

Is this normal, or there is a bug somewhere?

@MJCollett
Copy link

Perhaps you should show us how you define the Sol usertypes.

From a C++ (rather than Sol or Lua) point of view Test2::test does not actually overload Test1::test: it hides it. To get an C++ overload you need to include a using Test1::test; in the definition of Test2. This may or may not be relevant to your issue.

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

No branches or pull requests

2 participants