@Override
    public Type typeCheck(Scope<Type> scope) {
        Type conditionType = function.typeCheck(scope);
        // If the condition is validated, then the expression must be a truthy type
        if (result != null) {
            scope.getDeclaration(result).ifPresent(entry -> {
                throw new SourceException(String.format("Invalid shadowing of `%s` (first declared on line %s)",
                        result,
                        entry.getKey().getSourceLocation().getLine()), result);
            });
            scope.insert(result, conditionType.provenTruthy());
        }
        return conditionType;
    }
Gets the function used to express this condition.

@return the function for this condition.
smithy-rules-engine/src/main/java/software/amazon/smithy/rulesengine/language/syntax/rule/Condition.java