Kris Thielemans
2015-05-31 23:16:15 UTC
Dear Joel et al
I’m trying Joel’s updates to the matlab code. It seems that the recent refactoring of constant lookup (commit c8eafe02c0612da32acbdb13e1e8f0294718bef5) breaks things in enums in a class. A test case is as follows:
-------------
%module test
%{
%}
class Succeeded
{
public:
enum value { yes, no };
};
----------
The problem seems to be that memberconstantHandler still has the old convention of only passing the name to the wrapper (as opposed to passing the id as well).
I think this needs to be fixed by modifying constantWrapper to not emit anything when not in a class, and leave it for memberconstantHandler. (I tried the alternative, i.e. let constWrapper handle the memberconstant case as well but can’t get that to work because sym:name seems to include the class name then).
I am quite confused when constantWrapper is called and what it should handle (is there any documentation for that?). I think I could fix this by copying most of the code in constantWrapper to memberconstantHandler, but that’d be a terrible idea. So I’m afraid I can’t give you a patch…
Can anyone help?
Kris
PS: I didn’t file this as a github bug in your fork as I’m guessing that William et al wouldn’t see that.
PS: This would have been caught by the enums test-case. we clearly need to get the test-suite working... I'm trying to get some help for that.
------------------------------------------------------------------------------
I’m trying Joel’s updates to the matlab code. It seems that the recent refactoring of constant lookup (commit c8eafe02c0612da32acbdb13e1e8f0294718bef5) breaks things in enums in a class. A test case is as follows:
-------------
%module test
%{
%}
class Succeeded
{
public:
enum value { yes, no };
};
----------
The problem seems to be that memberconstantHandler still has the old convention of only passing the name to the wrapper (as opposed to passing the id as well).
I think this needs to be fixed by modifying constantWrapper to not emit anything when not in a class, and leave it for memberconstantHandler. (I tried the alternative, i.e. let constWrapper handle the memberconstant case as well but can’t get that to work because sym:name seems to include the class name then).
I am quite confused when constantWrapper is called and what it should handle (is there any documentation for that?). I think I could fix this by copying most of the code in constantWrapper to memberconstantHandler, but that’d be a terrible idea. So I’m afraid I can’t give you a patch…
Can anyone help?
Kris
PS: I didn’t file this as a github bug in your fork as I’m guessing that William et al wouldn’t see that.
PS: This would have been caught by the enums test-case. we clearly need to get the test-suite working... I'm trying to get some help for that.
------------------------------------------------------------------------------