Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

No way of Invoking a generic method with multiple overload and out/byref parameters #641

Copy link
Copy link
@RockHornetz

Description

@RockHornetz
Issue body actions

Environment

  • Pythonnet version: 2.4.0.dev0
  • Python version: 3.6.4
  • Operating System: Windows 7 64

Details

  • Describe what you were trying to get done.

    Invoke a generic method with multiple overload and out parameters

  • What commands did you run to trigger this issue?

//C# SIDE
//...
    public void GetProperty<T>(string propertyName, out T value){...} //<= The one i'm trying to get
    public void GetProperty<T>(string propertyName, out T value, bool asRef){...}
    public void GetProperty<T>(string propertyName, out T value, int index){...}
    public void GetProperty<T>(string propertyName, out T value, int index, bool asRef){...}
    public void GetProperty<T>(PropertyID propertyID, out T value, int index){...}
    public void GetProperty<T>(PropertyID propertyID, out T value, bool asRef){...}
//...
#PYTHON SIDE, What i've tested so far
object.GetProperty[System.Single]('PropertyName', None) #FAIL
object.GetProperty[System.Single]('PropertyName', System.Single(0).GetType()) #FAIL
object.GetProperty[System.Single]('PropertyName', System.Single(0).GetType().MakeByRefType()) #FAIL

object.GetProperty('PropertyName', None) #FAIL
object.GetProperty('PropertyName', System.Single(0).GetType()) #FAIL
object.GetProperty('PropertyName', System.Single(0).GetType().MakeByRefType()) #FAIL

object.GetProperty.Overloads[System.String, System.Single(0).GetType().MakeByRefType()]('PropertyName', None) #FAIL
  • Traceback:
   Traceback (most recent call last):
  File "C:\Users\{USER}\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Users\{USER}\AppData\Local\Programs\Python\Python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:/PythonWorkspace/{MODULE}\__main__.py", line 5, in <module>
    test_pythonnet.launchTest()
  File "D:/PythonWorkspace/{MODULE}\test_pythonnet.py", line 45, in launchTest
    test = object.GetProperty[System.Single]('PropertyName', byref)
TypeError: No method matches given arguments

So, i'm at a loss here, do i need to do all the reflection stuff by hand ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.