Interface ExprMirror.BranchingMirror

    • Method Detail

      • branchesMatch

        boolean branchesMatch​(Predicate<? super ExprMirror> condition)
        Returns true if every result expression matches the given predicate.
      • setStandalone

        default void setStandalone()
        Record on the AST node that is is a standalone expression. This accounts for special cases in the spec which are made for numeric and boolean conditional expressions. For those types of standalone exprs, the branches may have an additional implicit unboxing/widening conversion, that does not depend on the usual target type (the context of the ternary itself), but just on the other branch.
      • isEquivalentToUnderlyingAst

        default boolean isEquivalentToUnderlyingAst()
        Description copied from interface: ExprMirror
        Returns true if this mirror and its subexpressions are equivalent to the underlying AST node. This is only relevant when making mirrors that are not exactly equal to the AST node (eg, omitting explicit type arguments), in order to check if the transformation does not change the meaning of the program. It verifies that method and constructor calls are overload-selected to the same compile-time declaration, and that nested lambdas have the same type as in the AST.

        This mirror's state, as filled-in during type resolution by Infer using the various setters of ExprMirror interfaces, is compared to the AST's corresponding state. Consequently, if this state is missing (meaning, that no overload resolution has been run using this mirror), the analysis cannot be performed and an exception is thrown.

        Specified by:
        isEquivalentToUnderlyingAst in interface ExprMirror