File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed
Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -162,5 +162,31 @@ public void RawPyObjectProxy()
162162 var proxiedHandle = pyObjectProxy . GetAttr ( "Handle" ) . As < IntPtr > ( ) ;
163163 Assert . AreEqual ( pyObject . Handle , proxiedHandle ) ;
164164 }
165+
166+ // regression for https://github.com/pythonnet/pythonnet/issues/451
167+ [ Test ]
168+ public void CanGetListFromDerivedClass ( )
169+ {
170+ using var scope = Py . CreateScope ( ) ;
171+ scope . Import ( typeof ( GetListImpl ) . Namespace , asname : "test" ) ;
172+ scope . Exec ( @"
173+ class PyGetListImpl(test.GetListImpl):
174+ pass
175+ " ) ;
176+ var pyImpl = scope . Get ( "PyGetListImpl" ) ;
177+ dynamic inst = pyImpl . Invoke ( ) ;
178+ List < string > result = inst . GetList ( ) ;
179+ CollectionAssert . AreEqual ( new [ ] { "testing" } , result ) ;
180+ }
181+ }
182+
183+ public interface IGetList
184+ {
185+ List < string > GetList ( ) ;
186+ }
187+
188+ public class GetListImpl : IGetList
189+ {
190+ public List < string > GetList ( ) => new ( ) { "testing" } ;
165191 }
166192}
You can’t perform that action at this time.
0 commit comments