Overload
class Overload extends Message
An overload indicates a function's parameter types and return type, and may optionally include a function body described in terms of [Expr][google.api.expr.v1alpha1.Expr] values.
Functions overloads are declared in either a function or method
call-style. For methods, the params[0]
is the expected type of the
target receiver.
Overloads must have non-overlapping argument types after erasure of all
parameterized type variables (similar as type erasure in Java).
Generated from protobuf message google.api.expr.v1alpha1.Decl.FunctionDecl.Overload
Methods
Constructor.
Required. Globally unique overload name of the function which reflects the function name and argument types.
Required. Globally unique overload name of the function which reflects the function name and argument types.
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
The type param names associated with the function declaration.
The type param names associated with the function declaration.
Required. The result type of the function. For example, the operator
string.isEmpty()
would have result_type
of kind: BOOL
.
Required. The result type of the function. For example, the operator
string.isEmpty()
would have result_type
of kind: BOOL
.
Whether the function is to be used in a method call-style `x.f(.
Whether the function is to be used in a method call-style `x.f(.
Documentation string for the overload.
Documentation string for the overload.
Details
at line 114
__construct(array $data = NULL)
Constructor.
at line 128
string
getOverloadId()
Required. Globally unique overload name of the function which reflects the function name and argument types.
This will be used by a [Reference][google.api.expr.v1alpha1.Reference] to indicate the overload_id
that
was resolved for the function name
.
Generated from protobuf field string overload_id = 1;
at line 143
$this
setOverloadId(string $var)
Required. Globally unique overload name of the function which reflects the function name and argument types.
This will be used by a [Reference][google.api.expr.v1alpha1.Reference] to indicate the overload_id
that
was resolved for the function name
.
Generated from protobuf field string overload_id = 1;
at line 164
RepeatedField
getParams()
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
Param types are disjoint after generic type parameters have been
replaced with the type DYN
. Since the DYN
type is compatible with
any other type, this means that if A
is a type parameter, the
function types int<A>
and int<int>
are not disjoint. Likewise,
map<string, string>
is not disjoint from map<K, V>
.
When the result_type
of a function is a generic type param, the
type param name also appears as the type
of on at least one params.
Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2;
at line 183
$this
setParams(Type[]|RepeatedField $var)
List of function parameter [Type][google.api.expr.v1alpha1.Type] values.
Param types are disjoint after generic type parameters have been
replaced with the type DYN
. Since the DYN
type is compatible with
any other type, this means that if A
is a type parameter, the
function types int<A>
and int<int>
are not disjoint. Likewise,
map<string, string>
is not disjoint from map<K, V>
.
When the result_type
of a function is a generic type param, the
type param name also appears as the type
of on at least one params.
Generated from protobuf field repeated .google.api.expr.v1alpha1.Type params = 2;
at line 199
RepeatedField
getTypeParams()
The type param names associated with the function declaration.
For example, function ex<K,V>(K key, map<K, V> map) : V
would yield
the type params of K, V
.
Generated from protobuf field repeated string type_params = 3;
at line 213
$this
setTypeParams(string[]|RepeatedField $var)
The type param names associated with the function declaration.
For example, function ex<K,V>(K key, map<K, V> map) : V
would yield
the type params of K, V
.
Generated from protobuf field repeated string type_params = 3;
at line 228
Type
getResultType()
Required. The result type of the function. For example, the operator
string.isEmpty()
would have result_type
of kind: BOOL
.
Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4;
at line 241
$this
setResultType(Type $var)
Required. The result type of the function. For example, the operator
string.isEmpty()
would have result_type
of kind: BOOL
.
Generated from protobuf field .google.api.expr.v1alpha1.Type result_type = 4;
at line 258
bool
getIsInstanceFunction()
Whether the function is to be used in a method call-style `x.f(.
..)of a function call-style
f(x, ...).
For methods, the first parameter declaration,
params[0]` is the
expected type of the target receiver.
Generated from protobuf field bool is_instance_function = 5;
at line 273
$this
setIsInstanceFunction(bool $var)
Whether the function is to be used in a method call-style `x.f(.
..)of a function call-style
f(x, ...).
For methods, the first parameter declaration,
params[0]` is the
expected type of the target receiver.
Generated from protobuf field bool is_instance_function = 5;
at line 287
string
getDoc()
Documentation string for the overload.
Generated from protobuf field string doc = 6;
at line 299
$this
setDoc(string $var)
Documentation string for the overload.
Generated from protobuf field string doc = 6;