![]() |
Spicy
|
#include <coercer.h>
Public Member Functions | |
| operator bool () const | |
| CoercedExpression (Expression *src) | |
| CoercedExpression (QualifiedType *src, Expression *coerced) | |
| CoercedExpression ()=default | |
| CoercedExpression (const result::Error &error) | |
Public Attributes | |
| Result< Expression * > | coerced |
| Expression * | nexpr = {} |
| bool | consider_type_changed = false |
Return type for the functions doing expression coercion.
|
inline |
Represents a successful coercion that led the source expression not changing, which will be assigned to the coerced field.
coerced field value for anywhere where the coerced expression is expected.| src | the original source expression |
|
inline |
Represents a successful coercion that led to a new expression different from the source expression.
| src | the original source expression's type |
| coerced | the resulting expression that src was coerced to |
|
default |
Represents an unsuccessful coercion.
|
inline |
Represents an unsuccessful coercion, carrying an error message along explaining why it failed.
|
inline |
Returns true if coercion was successful.
| Result<Expression*> hilti::CoercedExpression::coerced |
Coerced expression if successful, an error if not. This will be set even if the coerced expression ends up being identical to the source expression.
| bool hilti::CoercedExpression::consider_type_changed = false |
If coerced is set, true if type of new expression's type is to be considered changed compared to source expression's type for overload resolution
| Expression* hilti::CoercedExpression::nexpr = {} |
Coerced expression if successful and the coerced expression is not identical to original one; unset otherwise.