Fix for 'self' being used as a parameter name

This commit is contained in:
William S Fulton 2014-10-30 07:22:59 +00:00
commit 6029b2f7d8
5 changed files with 19 additions and 12 deletions

View file

@ -1,13 +1,15 @@
// Checks if collisions of argument names with target language keywords are
// resolved properly when directors are used (currently only »abstract« for
// C#, D and Java is checked).
// resolved properly when directors are used
%module(directors="1") director_keywords
%warnfilter(SWIGWARN_PARSE_KEYWORD);
%feature("director") Foo;
%inline %{
struct Foo {
virtual ~Foo() {}
virtual void bar(int abstract) {}
virtual void check_abstract(int abstract) {} // for Java, C#, D...
virtual void check_self(int self) {} // self for Python
};
%}

View file

@ -0,0 +1,5 @@
from director_keywords import *
f = Foo()
f.check_self(20)