anchor.diff:          if (value is AbortConstant) return value;
           env.addVariableValue(parameter, value);
         }
  -      return function.body.accept(this);
  +      Statement body = function.body;
  +      if (body is ReturnStatement) {
  +        if (!enableConstFunctions) {
  +          return createInvalidExpressionConstant(
  +              node, "Return statements are not supported.");
  +        }
  +        return body.expression.accept(this);
  +      } else {
  +        return createInvalidExpressionConstant(
  +            node, "Unsupported statement: ${body.runtimeType}.");
  +      }
       });
  -  }
  -
  -  @override
  -  Constant visitReturnStatement(ReturnStatement node) {
  -    if (!enableConstFunctions) {
  -      return createInvalidExpressionConstant(
  -          node, "Return statements are not supported.");
  -    }
  -    return node.expression.accept(this);
     }
   
     @override
  
positive.code:   }
  
    @override
    Constant defaultTreeNode(Node node) {
      // Only a subset of the expression language is valid for constant
      // evaluation.
      return createInvalidExpressionConstant(
  
negative.code:   }
  }
  
  class ConstantEvaluator extends ExpressionVisitor<Constant> {
    final ConstantsBackend backend;
    final NumberSemantics numberSemantics;
    ConstantIntFolder intFolder;
  