Quantcast
Channel: Dafny: An Automatic Program Verifier for Functional Correctness
Viewing all articles
Browse latest Browse all 1106

Closed Unassigned: Dafny compiler generates illegal C# code for some let bindings [89]

$
0
0
For the Dafny code below, the Dafny compiler generates illegal C# code:

``
method F() returns(x:int)
ensures x == 6;
{
x := 5;
x := (var y := 1; y + x);
}

method Main()
{
var x := F();
print x;
}
``

The C# compiler generates the following error:

``
Cannot use ref or out parameter 'x' inside an anonymous method, lambda expression, or query expression
``


Viewing all articles
Browse latest Browse all 1106

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>