Skip to content

Dafny internal error - auto contracts #508

@kjx

Description

@kjx

Failing code

class {:autocontracts} Rat {
   const name : string

    twostate predicate Valid() {
        && fresh(Repr - old(Repr))
    } //Darth: all too easy...

    constructor(n : string) 
     ensures name == n
      {
        name := n;
       Contents := {};
        Family := null;
    }
    
    method setFamily(r : Rat)
    {  
        Family := r;
    }

   var Contents : set<Rat>
// 
    var Family : Rat?
}

Steps to reproduce the issue

  • Dafny version: 4.8.1.0
  • Dafny VSCode extension version: 3.4.1
    Expected behavior

verification error

Actual behavior

crash

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions