Whiley / WhileyCompiler

The Whiley Compiler (WyC)
http://whiley.org
Apache License 2.0
217 stars 36 forks source link

Cannot Dereference Dynamically Sized (Template) Type #1144

Open DavePearce opened 2 years ago

DavePearce commented 2 years ago

Test 001137 is as follows:

method assign<T>(&T x, &T y, T v1, T v2)
ensures *x == v1
ensures *y == v2:
    // Broken if x == y
    *x = v1
    *y = v2

This doesn't allow the dereference. I think to make this work, we need some information about T --- namely that it is statically sized. This is evident from the fact that it is passed as a parameter.