General call commands

Issue #93 resolved
Yusuf Ismail repo owner created an issue

Two general commands, call-static and call-instance that can be used to call any loaded C# method

Proposed signatures

call-static className funcName args

call-instance className funcName monoTargetType args

Current Problems

Currently they will throw an ambiguous method error when there are 2 overloads of the same function. A better way to address this needs to be determined

Potential Solutions

Different solutions to help solve the ambiguous overload use case. Some of these may be combined together.

  1. Do nothing - throw a clear error with all of the ambiguous overloads
  2. Use the supplied args count, pick the overload with the matching arg count

    1. If two overloads have the same number of args, fail
  3. Same as 2, but

    1. If there are two overloads with the same number of args, but with different number of default args, potentially resort to that that uses the least number of default args, but fail
    2. else, fail
  4. Additional overload call-static className funcName types args

    1. types is a type array specifying the type of each argument. Much more verbose than the normal variant, but has zero ambiguity (and hence would only be used in the case that the original command fails)

Comments (4)

  1. Yusuf Ismail reporter

    Prototypes for both call-static and call-instance are complete; neither handle the overload problem

  2. Log in to comment