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

problem with same method in class and base class #117

Closed
karsten001 opened this issue Oct 26, 2014 · 0 comments
Closed

problem with same method in class and base class #117

karsten001 opened this issue Oct 26, 2014 · 0 comments

Comments

@karsten001
Copy link

My last issue with a similar problem has been fixed so fast, thank you very much for doing this. I found another issue. If the base class has the same method with different parameters lua always tries to match the method to the main class and so you will get an error that the parameter does not match.

C# classes

public class parameter
{
    string param1;
    string param2;
}

public class master
{
    public static string read( parameter test )
    {
        return "test";
    }
}


public class testClass : master 
{
    public String strData;
    public int intData;
    public static string read( int test )
    {
        return "test";
    }

    public static string read2(int test)
    {
        return "test";
    }
    public static string read2(parameter test)
    {
        return "test";
    }
}

lua code:

luanet.load_assembly 'D_4_0_Prototype.Test'
luanet.import_type 'D_4_0_Prototype.Test.master'
testclass = luanet.import_type 'D_4_0_Prototype.Test.testClass'
parameter = luanet.import_type 'D_4_0_Prototype.Test.parameter'
p=parameter()

result:

testclass.read2(1)   -- is working
testclass.read2(p)   -- is working
testclass.read(p)     -- is not working. it is also not working if the method in base class has two parameters instead of one
testclass.read(1)     -- is working

You will also get another error messages if you first call

testclass.read(1) 

and then

testclass.read(p)

Regards

Karsten

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

1 participant