Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Invoke

func self(receiver: object?, params arguments: object?[]) -> Result<object?, ReflectionError>

Declaring type: MethodReflectionExtensions
Module: System.Runtime.Reflection
Assembly: System.Runtime.dll

Extension from MethodReflectionExtensions.Invoke

Invokes a described public IL method.

Parameters

Name Type Description
self MethodInfo Runtime-backed method descriptor.
receiver Object? Compatible non-null instance for instance methods; null for static methods.
arguments Object?[] Exact argument count and compatible object values.

Return value

Result<Object?, ReflectionError>

The boxed/reference result, null for a void-returning method, or a validation error.

Remarks

Nongeneric reference classes only. Exact boxed built-in scalars or assignable references/null; no coercion, optional defaults, byref/out or custom value payloads. User Faults are terminal. Side effects are not transactional. Virtual instance methods use ordinary dispatch.