File tree Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Expand file tree Collapse file tree 2 files changed +28
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ void run()
48
48
if ( myNewBar == null )
49
49
throw new Exception ( "non-null pointer marshalling problem" ) ;
50
50
myNewBar . x = 10 ;
51
+
52
+ my . testSwigDerivedClassHasMethod ( ) ;
51
53
}
52
54
}
53
55
}
@@ -69,6 +71,14 @@ public override Bar pmethod(Bar b) {
69
71
throw new Exception ( "null not received as expected" ) ;
70
72
return b ;
71
73
}
74
+
75
+ public bool nonVirtual ( ) {
76
+ throw new Exception ( "non-virtual overrides virtual method" ) ;
77
+ }
78
+
79
+ public virtual bool nonOverride ( ) {
80
+ throw new Exception ( "non-override overrides virtual method" ) ;
81
+ }
72
82
}
73
83
74
84
}
Original file line number Diff line number Diff line change 65
65
66
66
%}
67
67
68
+ %typemap(cscode) MyClass %{
69
+ public void testSwigDerivedClassHasMethod () {
70
+ if (SwigDerivedClassHasMethod (" nonVirtual" , swigMethodTypes3))
71
+ throw new global::System.Exception (" non-overriding non-virtual method would be when connecting director" );
72
+ if (SwigDerivedClassHasMethod (" nonOverride" , swigMethodTypes4))
73
+ throw new global::System.Exception (" non-overriding virtual method would be when connecting director" );
74
+ }
75
+ %}
68
76
69
77
%feature(" director" ) MyClass;
70
78
@@ -122,8 +130,16 @@ public:
122
130
return myclass->pmethod (b);
123
131
}
124
132
125
- // Collisions with generated method names
126
- virtual void Connect () { }
133
+ virtual void nonVirtual ()
134
+ {
135
+ }
136
+
137
+ virtual void nonOverride ()
138
+ {
139
+ }
140
+
141
+ // Collisions with generated method names
142
+ virtual void Connect () { }
127
143
};
128
144
129
145
template <class T >
You can’t perform that action at this time.
0 commit comments