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

Multiple static functions, with same name and different parameters in a class will only expose one #1851

Open
unier opened this Issue Aug 31, 2017 · 0 comments

Comments

Projects
None yet
1 participant
@unier

unier commented Aug 31, 2017

Example:

c++:

class SqBufferIoStream : public SqIoStream {
public:
	static std::shared_ptr<SqBufferIoStream> Open(const std::string& data);
	static std::shared_ptr<SqBufferIoStream> Open();
};

cython:

cdef extern from "SqBufferIoStream.h":
    cdef cppclass SqBufferIoStream:
        @staticmethod
        shared_ptr[SqBufferIoStream] Open(const string s)
        @staticmethod
        shared_ptr[SqBufferIoStream] Open()
Error compiling Cython file:
------------------------------------------------------------
        for command, description in c_map:
            p_map[command] = description
        return p_map

    def executeCommand(self, command, parameters):
        cdef shared_ptr[SqInputStream] b = dynamic_pointer_cast[SqInputStream, SqBufferIoStream](SqBufferIoStream.Open(_json.dumps(parameters)))
                                                                                                                     ^
------------------------------------------------------------

SqFoundationTypes.pyx:200:118: Call with wrong number of arguments (expected 0, got 1)

If I change to:

cdef extern from "SqBufferIoStream.h":
    cdef cppclass SqBufferIoStream:
        @staticmethod
        shared_ptr[SqBufferIoStream] Open()
        @staticmethod
        shared_ptr[SqBufferIoStream] Open(const string s)
Error compiling Cython file:
------------------------------------------------------------

    def executeCommand(self, command, parameters):
        cdef shared_ptr[SqInputStream] b = dynamic_pointer_cast[SqInputStream, SqBufferIoStream](SqBufferIoStream.Open(_json.dumps(parameters)))
        cdef SqKeyValueList data = SqJsonParser.ParseAsSqValue(b).get().GetKeyValueList()
        cdef SqKeyValueList c_kvl = self.c_this.get().ExecuteCommand(command, data)
        cdef shared_ptr[SqBufferIoStream] buf = SqBufferIoStream.Open()
                                                                    ^
------------------------------------------------------------

SqFoundationTypes.pyx:203:69: Call with wrong number of arguments (expected 1, got 0)

Version:

cython --version
Cython version 0.25.2

@unier unier changed the title from Multiple static functions, with same name and different parameters in a class will only expose only one to Multiple static functions, with same name and different parameters in a class will only expose one Aug 31, 2017

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