Function Members

Function members are members that contain executable code. The language determines the following categories of function members:

Except for static constructors, statements contained in function members are executed as a result of member invocations. The actual syntax of a function member invocation depends on the member category. The argument list of a function member invocation provides actual values or variable references corresponding to the parameters of the function member.

Invocations of methods, indexers, and instance constructors employ overload resolution to determine, which of a candidate set of function members to invoke. This process is described in §7.4.2

§7.4.2.1 describes the actual runtime process of invoking the function member.

Argument Lists

Each function member invocation contains an argument list that determines actual values or variable references corresponding to function member parameters. The syntax for specifying an argument list depends on the function member category:

The arguments of simple properties and events are always passed as value parameters. Indexer arguments are also passed as value parameters or as array parameters. Reference and output parameters are not supported for these categories of function members. Parameter types and their differences are described in the Methods: Method Parameters section.

Arguments of constructors, methods, or delegates are specified as an argument list:

argument-list:

(    argumentsopt   )

arguments:

argument

arguments   ,   argument

argument:

expression

Var   variable-reference

Out   variable-reference

variable-reference:

expression

An argument list consists of one or more arguments separated by commas. Each argument can take one of the following forms:

During the runtime processing of a function member invocation, the expressions or variable references of an argument list are calculated in order, from left to right, as follows:

Methods, indexers and instance constructors may have a variable number of parameters. Such function members are invoked either in their normal form or in their expanded form depending on which is applicable:

See also:

Expressions