Matches explicit casts.
This pattern only matches nodes of type expression.
Properties
castOperatorExplicit produces a record that contains the following properties:
| Name | Type | Description |
|---|---|---|
kind |
enum castKind |
Always `explicit`; see castKind |
operandExpression |
expression |
The expression being cast |
Inherits properties from:
Example
The following snippet of Java casts i to short:
int i = 5;
short a = (short) i;
... you could use the following CodeXM pattern to match it:
pattern castToShort {
castOperatorExplicit {
.type == shortType
}
};