+
+ # Check that `sub` is a subtype of `sup`.
+ # Do not display an error message.
+ #
+ # This method is used a an entry point for the modelize phase to test static subtypes.
+ # Some refinements could redefine it to collect statictics.
+ fun check_subtype(node: ANode, mmodule: MModule, anchor: nullable MClassType, sub, sup: MType): Bool
+ do
+ return sub.is_subtype(mmodule, anchor, sup)
+ end
+
+ # Check that `sub` and `sup` are equvalent types.
+ # Do not display an error message.
+ #
+ # This method is used a an entry point for the modelize phase to test static equivalent types.
+ # Some refinements could redefine it to collect statictics.
+ fun check_sametype(node: ANode, mmodule: MModule, anchor: nullable MClassType, sub, sup: MType): Bool
+ do
+ return sub.is_subtype(mmodule, anchor, sup) and sup.is_subtype(mmodule, anchor, sub)
+ end
+end
+
+redef class ANode
+ # The indication that the node did not pass some semantic verifications.
+ #
+ # This simple flag is set by a given analysis to say that the node is broken and unusable in
+ # an execution.
+ # When a node status is set to broken, it is usually associated with a error message.
+ #
+ # If it is safe to do so, clients of the AST SHOULD just skip broken nodes in their processing.
+ # Clients that do not care about the executability (e.g. metrics) MAY still process the node or
+ # perform specific checks to determinate the validity of the node.
+ #
+ # Note that the broken status is not propagated to parent or children nodes.
+ # e.g. a broken expression used as argument does not make the whole call broken.
+ var is_broken = false is writable