![]() |
P4C
The P4 Compiler
|
The right type can be implicitly cast to the left type. More...
Public Member Functions | |
| CanBeImplicitlyCastConstraint (const IR::Type *left, const IR::Type *right, const IR::Node *origin) | |
| CanBeImplicitlyCastConstraint (const IR::Type *left, const IR::Type *right, const TypeConstraint *derivedFrom) | |
| BinaryConstraint * | create (const IR::Type *left, const IR::Type *right) const override |
| void | dbprint (std::ostream &out) const override |
| DECLARE_TYPEINFO (CanBeImplicitlyCastConstraint, BinaryConstraint) | |
| bool | reportError (const TypeVariableSubstitution *subst) const override |
| virtual bool | reportError (const TypeVariableSubstitution *subst) const=0 |
| template<typename... Args> | |
| bool | reportError (const TypeVariableSubstitution *subst, const char *format, Args &&...args) const |
Public Member Functions inherited from P4::BinaryConstraint | |
| DECLARE_TYPEINFO (BinaryConstraint, TypeConstraint) | |
Public Member Functions inherited from P4::TypeConstraint | |
| DECLARE_TYPEINFO (TypeConstraint) | |
| template<typename... Args> | |
| bool | reportError (const TypeVariableSubstitution *subst, const char *format, Args &&...args) const |
| void | setError (cstring format, std::initializer_list< const IR::Node * > nodes) |
Public Member Functions inherited from IHasDbPrint | |
| void | print () const |
Public Member Functions inherited from ICastable | |
| template<typename T > | |
| T & | as () |
| Tries to convert the class to type T. A BUG occurs if the cast fails. | |
| template<typename T > | |
| const T & | as () const |
| Tries to convert the class to type T. A BUG occurs if the cast fails. | |
| template<typename T > | |
| T * | checkedTo () |
| Performs a checked cast. A BUG occurs if the cast fails. | |
| template<typename T > | |
| const T * | checkedTo () const |
| Performs a checked cast. A BUG occurs if the cast fails. | |
Public Member Functions inherited from RTTI::Base | |
| template<typename T > | |
| bool | is () const noexcept |
| virtual bool | isA (TypeId typeId) const noexcept=0 |
| template<typename T > | |
| const T * | to () const noexcept |
Same as to, but returns const pointer to T. | |
| template<typename T > | |
| T * | to () noexcept |
| virtual TypeId | typeId () const noexcept=0 |
Additional Inherited Members | |
Public Attributes inherited from P4::BinaryConstraint | |
| const IR::Type * | left |
| const IR::Type * | right |
Protected Member Functions inherited from P4::BinaryConstraint | |
| BinaryConstraint (const IR::Type *left, const IR::Type *right, const IR::Node *origin) | |
| BinaryConstraint (const IR::Type *left, const IR::Type *right, const TypeConstraint *derivedFrom) | |
| void | validate () const |
Protected Member Functions inherited from P4::TypeConstraint | |
| TypeConstraint (const IR::Node *origin) | |
| TypeConstraint (const TypeConstraint *derivedFrom) | |
| std::string | explain (size_t index, Explain *explainer) const |
| std::string | localError (Explain *explainer) const |
Protected Member Functions inherited from RTTI::Base | |
| virtual const void * | toImpl (TypeId typeId) const noexcept=0 |
Protected Attributes inherited from P4::TypeConstraint | |
| const TypeConstraint * | derivedFrom = nullptr |
| Constraint which produced this one. May be nullptr. | |
| const IR::Node * | origin = nullptr |
| Place in source code which originated the contraint. May be nullptr. | |
The right type can be implicitly cast to the left type.
|
inline |
The Constraints actually form a stack and the error message is composed in reverse order, from bottom to top. The top of the stack has no 'derivedFrom' field, and it contains the actual source position where the analysis started.