Example #1
0
 //^^ ensures result.GetType() == this.GetType();
 //^^ ensures result.ContainingBlock == containingBlock;
 /// <summary>
 /// Makes a copy of this expression, changing the ContainingBlock to the given block.
 /// </summary>
 //^ [MustOverride]
 public override Expression MakeCopyFor(BlockStatement containingBlock)
 {
     if (containingBlock == this.ContainingBlock) return this;
       VccLambda result = new VccLambda(containingBlock, this);
       result.CopyTriggersFromTemplate(this);
       return result;
 }
Example #2
0
 //^ requires template.ContainingBlock != containingBlock;
 //^ ensures this.containingBlock == containingBlock;
 /// <summary>
 /// A copy constructor that allocates an instance that is the same as the given template, except for its containing block.
 /// </summary>
 /// <param name="containingBlock">A new value for containing block. This replaces template.ContainingBlock in the resulting copy of template.</param>
 /// <param name="template">The template to copy.</param>
 protected VccLambda(BlockStatement containingBlock, VccLambda template)
     : base(containingBlock, template)
 {
     this.lambdaExpr = template.lambdaExpr.MakeCopyFor(base.Condition.ContainingBlock);
 }