Skip to content

Commit

Permalink
Default to reads *
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Aug 15, 2023
1 parent 20118e6 commit f249adb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/DafnyCore/AST/Members/Method.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ public class Method : MemberDecl, TypeParameter.ParentType, IMethodCodeContext,
public readonly List<Formal> Ins;
public readonly List<Formal> Outs;
public readonly List<AttributedExpression> Req;
// TODO: make a Specification<FrameExpression> as well? Function.Reads isn't...
public readonly List<FrameExpression> Reads;
public readonly Specification<FrameExpression> Mod;
public readonly List<AttributedExpression> Ens;
Expand Down Expand Up @@ -279,6 +280,10 @@ public void Resolve(ModuleResolver resolver) {
resolver.ConstrainTypeExprBool(e.E, "Precondition must be a boolean (got {0})");
}

// TODO: May not be the right place to do this, and may want something like InferredDecreases
if (!Reads.Any()) {
Reads.Add(new FrameExpression(tok, new WildcardExpr(tok), null));
}
foreach (FrameExpression fe in Reads) {
resolver.ResolveFrameExpressionTopLevel(fe, FrameExpressionUse.Reads, this);
if (IsLemmaLike) {
Expand Down

0 comments on commit f249adb

Please sign in to comment.