//private static MethodDeclarationSyntax AddObjectInvariantMethod(ClassDeclarationSyntax class_to_add_to) private static MethodDeclarationSyntax AddObjectInvariantMethod(TypeDeclarationSyntax class_to_add_to) { Contract.Ensures(Contract.Result <MethodDeclarationSyntax>() != null); var oima = new ObjectInvariantMethodAdder(); //var newclass = oima.Visit(class_to_add_to) as ClassDeclarationSyntax; var newclass = oima.Visit(class_to_add_to) as TypeDeclarationSyntax; return(oima.invariantmethod); }
//private static MethodDeclarationSyntax AddObjectInvariantMethod(ClassDeclarationSyntax class_to_add_to) private static MethodDeclarationSyntax AddObjectInvariantMethod(TypeDeclarationSyntax class_to_add_to) { Contract.Ensures(Contract.Result<MethodDeclarationSyntax>() != null); var oima = new ObjectInvariantMethodAdder(); //var newclass = oima.Visit(class_to_add_to) as ClassDeclarationSyntax; var newclass = oima.Visit(class_to_add_to) as TypeDeclarationSyntax; return oima.invariantmethod; }