Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge functionality to filter out tests #9

Open
wants to merge 14 commits into
base: Latest
Choose a base branch
from
Prev Previous commit
Next Next commit
Fix: No more crashing on hovering bodies of nested match statements (d…
  • Loading branch information
MikaelMayer authored Jul 1, 2022
commit 54877921265cb8619284d370eb588d146af4d282
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Upcoming

- fix: Hovering over variables and methods inside cases of nested match statements work again (https://github.com/dafny-lang/dafny/pull/2334)
- fix: Fix bug in translation of two-state predicates with heap labels. (https://github.com/dafny-lang/dafny/pull/2300)
- fix: Check that arguments of 'unchanged' satisfy enclosing reads clause. (https://github.com/dafny-lang/dafny/pull/2302)
- fix: Caching in the language server does not prevent gutter icons from being updated correctly. (https://github.com/dafny-lang/dafny/pull/2312)
Expand Down
2 changes: 1 addition & 1 deletion Source/Dafny/Resolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11964,7 +11964,7 @@ public RBranchStmt(IToken tok, int branchid, List<ExtendedPattern> patterns, Lis
}

public RBranchStmt(int branchid, NestedMatchCaseStmt x, Attributes attrs = null) : base(x.Tok, branchid, new List<ExtendedPattern>()) {
this.Body = x.Body.ConvertAll((new Cloner()).CloneStmt);
this.Body = new List<Statement>(x.Body); // Resolving the body will insert new elements.
this.Attributes = attrs;
this.Patterns.Add(x.Pat);
}
Expand Down
11 changes: 11 additions & 0 deletions Source/DafnyLanguageServer.Test/Lookup/HoverTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -427,5 +427,16 @@ function ToRelativeIndependent(): (p: Position)
}
");
}

[TestMethod]
public async Task HoveringVariablesInsideNestedMatchStmtWorks() {
await AssertHover(@"
lemma dummy(e: int) {
match e {
case _ => var xx := 1;
^[```dafny\nghost xx: int\n```]
}
}");
}
}
}