- Notifications
You must be signed in to change notification settings - Fork749
Closed

Description
Environment
- Pythonnet version: 2.4.0
- Python version: Python 3.7.4
- Operating System: Windows 10 (18362.356)
Details
- Describe what you were trying to get done.
Call a generic method taking a list parameter.
- What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
C# library:
usingSystem.Collections.Generic;namespaceCSLib{publicstaticclassCSLib{publicstaticboolGetBool()=>true;publicstaticvoidTestValue<T>(Tt){}publicstaticList<bool>GetBoolList()=>newList<bool>(){true,false};publicstaticvoidTestList<T>(List<T>list){}publicstaticvoidTest(){TestValue<bool>(GetBool());TestList<bool>(GetBoolList());}}}
Python code:
fromclrimportAddReferencefrompathlibimportPathAddReference(str(Path.cwd()/"cslib/bin/Debug/netstandard2.0/cslib.dll"))fromSystemimportBooleanfromCSLibimportCSLibCSLib.TestValue[Boolean](CSLib.GetBool())CSLib.TestList[Boolean](CSLib.GetBoolList())
It works fine when the type argument is used directly, but fails when it is insideList<>
.
- If there was a crash, please include the traceback here.
Traceback (mostrecentcalllast):File"a.py",line11,in<module>CSLib.TestList[Boolean](CSLib.GetBoolList())TypeError:NomethodmatchesgivenargumentsforTestList
Metadata
Metadata
Assignees
Labels
No labels