Skip to content

Commit

Permalink
Fixed up VS plug-in to handle shared destructors
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustan Leino committed Apr 16, 2017
1 parent 41b8b11 commit 68a0f31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Source/DafnyExtension/IdentifierTagger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@ bool ComputeIdentifierRegions(Microsoft.Dafny.Program program, ITextSnapshot sna
var dt = (DatatypeDecl)d;
foreach (var ctor in dt.Ctors) {
foreach (var dtor in ctor.Destructors) {
if (dtor.CorrespondingFormal.HasName) {
IdRegion.Add(newRegions, program, dtor.tok, dtor, null, "destructor", true, module);
var i = dtor.EnclosingCtors.IndexOf(ctor);
var formal = dtor.CorrespondingFormals[i];
if (formal.HasName) {
IdRegion.Add(newRegions, program, formal.tok, dtor, null, "destructor", true, module);
}
}
}
Expand Down

0 comments on commit 68a0f31

Please sign in to comment.