An invocation expression consists of an invocation target, followed by an open parenthesis, followed by an optional argument list, and followed by a close parenthesis. If there are no arguments, the parenthesis may be omitted. The invocation target must either be:
With
statement is assumed. If there is no containing With
statement, an error occurs. If no period or expression is specified, an implicit Me.
is assumed. If Me
is not legal in the expression context, an error occurs.MyClass
followed by a period and an identifier. MyClass
is equivalent to Me
, but all method invocations on it are non-virtual. Thus, the method called will not be affected by the runtime type of the value the method is being called on. It may not be used in shared methods.MyBase
followed by a period and an identifier. MyBase
represents a variable whose type is the base type of the type containing the expression and whose value is the instance of the type being executed. It may be used in shared methods as a way of getting at shadowed members. It is illegal to call abstract base methods using MyBase
.Given a set of one or more methods referred to by an invocation target, overload resolution is applied to pick a single method applicable to the given argument list. If no method is applicable, an error occurs. The value of an invocation expression is the value returned from the method. The method must be a function unless the invocation expression is the argument to an invocation statement.
At runtime, the argument list will be evaluated first, then the invocation target expression. If the invocation target expression references a shared method, the expression will not be evaluated as it is unnecessary.
(
[ ArgumentList ] )
].
] IdentifierOrKeyword |MyClass
.
IdentifierOrKeyword |MyBase
.
IdentifierOrKeyword |