Ejemplo n.º 1
0
 public override MethodContract VisitMethodContract(MethodContract contract)
 {
   if (contract == null) return null;
   contract = (MethodContract)contract.Clone();
   //^ assume this.TargetMethod != null;
   contract.DeclaringMethod = this.TargetMethod;
   contract.ensures = this.VisitEnsuresList(contract.ensures);
   contract.modifies = this.VisitExpressionList(contract.modifies);
   contract.requires = this.VisitRequiresList(contract.requires);
   return contract;
 }
Ejemplo n.º 2
0
 public override MethodContract VisitMethodContract(MethodContract contract)
 {
   if (contract == null) return null;
   MethodContract dup = (MethodContract)this.DuplicateFor[contract.UniqueKey];
   if (dup != null) return dup;
   //Make sure not to break the relation between contract.LocalForResult and
   //references to contract.LocalForResult in the contract:
   //Revised: seems that code for implementing an interface property depends on relation being broken.
   /*
   Local localForResult = contract.LocalForResult;
   if (localForResult != null) {
     localForResult = new Local(localForResult.Name, localForResult.Type);
     this.DuplicateFor[contract.LocalForResult.UniqueKey] = localForResult;
   }
   */      
   contract = (MethodContract)contract.Clone();
   //contract.LocalForResult = localForResult;
   //^ assume this.TargetMethod != null;
   contract.DeclaringMethod = this.TargetMethod;
   contract.ensures = this.VisitEnsuresList(contract.ensures);
   contract.modifies = this.VisitExpressionList(contract.modifies);
   contract.requires = this.VisitRequiresList(contract.requires);
   return contract;
 }