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

Edited Unassigned: Generic type equality for datatypes with iset and imap [162]

$
0
0
The example below gives errors about type equality in the A and C cases, but not the B or D cases, nor in the cases that don't use datatypes, which suggests there's a datatype-related code path that's not being handled correctly for iset and imap. Specifically, the error says:

> Error: type parameter 0 (T) passed to method foo must support equality (got A)

```
method foo<T(==)>(x:T)

datatype A = A(s:iset<int>)
datatype B = B(s:set<int>)
datatype C = C(s:imap<int,int>)
datatype D = D(s:map<int,int>)

method bar()
{
var a:A;
foo(a);

var b:B;
foo(b);

var c:C;
foo(c);

var d:D;
foo(d);

var s:iset<int>;
foo(s);

var s':imap<int,int>;
foo(s');
}
```

Viewing all articles
Browse latest Browse all 1106

Trending Articles



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