How can I declare a method requiring a wildcard permission and returning exactly the same permission.
I would like the write something like this:
field fd:Int
method foo(p:Ref) returns (res:Int)
requires acc(p.fd,wildcard)
ensures acc(p.fd,old(perm(p.fd)))
{
res := p.fd
}
But then I get an error.
Consistency error: Perm and forperm in this context are only allowed if nested under inhale-exhale assertions.