#75 [ocaml] mistake in renaming overloaded methods

closed-accepted
None
5
2007-09-18
2004-04-22
Anonymous
No

Renaming for overloaded member functions in a class
works fine about everywhere except in the method table,
where the string tag is not renamed. For example:
class foo {
...
void do_something (int i);
void do_somthing (string s);
...
};

We define the following in the .i file:

%rename(do_something_i) do_something(int)
%rename(do_something_s) do_something(string)

in the method_table generated, you will see:

"do_something", do_something_i;
"do_something", do_something_s;

Discussion

  • William Fulton

    William Fulton - 2004-10-07
    • assigned_to: nobody --> arty
     
  • Olly Betts

    Olly Betts - 2006-09-25
    • summary: mistake in renaming overloaded methods --> [ocaml] mistake in renaming overloaded methods
     
  • Olly Betts

    Olly Betts - 2006-09-25

    Logged In: YES
    user_id=14972

    Assuming that the method_table should contain:

    "do_something_i", do_something_i;
    "do_something_s", do_something_s;

    then the attached patch fixes this.

    I'll also attach a testcase, process with:

    ./swig -c++ -ocaml 940399.i

    And look at bug940399.mli.

    arty: can you take a look and say if this patch is correct?

     
  • Olly Betts

    Olly Betts - 2006-09-25

    Testcase

     
  • Olly Betts

    Olly Betts - 2006-09-25

    Logged In: YES
    user_id=14972

    The patch is against SWIG CVS HEAD incidentally, though I
    suspect it will apply to any recent version.

     
  • Olly Betts

    Olly Betts - 2006-09-27
    • labels: 505203 -->
     
  • Olly Betts

    Olly Betts - 2006-09-27

    Logged In: YES
    user_id=14972

    Moving to the patch tracker, now there's a patch...

    Also remove duplicate copy of .i file I somehow attached.

     
  • Olly Betts

    Olly Betts - 2007-05-31

    Logged In: YES
    user_id=14972
    Originator: NO

    The patch no longer applies, but still seems to be required so I've updated it.

    arty: could you have a quick look at this tiny patch? It seems to fix the problem the original reporter describes, but I know next to nothing about ocaml so I'm reluctant to just apply it, and the original report is anonymous, so I can't just ask the reporter...

    After processing the test case, it seems you need to look at bug940399.ml (NOT .mli as I said before).
    (Not sure if that's changed, or if I just made a typo before...)
    File Added: bug940399fix-updated.patch

     
  • Olly Betts

    Olly Betts - 2007-09-18
    • status: open --> closed-accepted
     
  • Olly Betts

    Olly Betts - 2007-09-18

    Logged In: YES
    user_id=14972
    Originator: NO

    My patch has sat here for almost a whole year now without comment, so I'm going to give up waiting and just apply it.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks