class C { function F(c: C, d: D): bool { true } method M(x: int) returns (y: int, c: C) requires F(#D.A, this); // 2 errors requires F(4, 5); // 2 errors requires F(this, #D.A); // good { } method Caller() { call m,n := M(true); // error on in-parameter call n,m := M(m); // 2 errors on out-parameters } } datatype D { A; } datatype Nothing { // error: no grounding constructor } datatype NeverendingList { // error: no grounding constructor Cons(int, NeverendingList); } datatype MutuallyRecursiveDataType { FromANumber(int); // this is the base case Else(TheCounterpart, C); } datatype TheCounterpart { TreeLike(TheCounterpart, TheCounterpart); More(MutuallyRecursiveDataType); } // these 'ReverseOrder_' order tests may be called white-box unit tests datatype ReverseOrder_MutuallyRecursiveDataType { FromANumber(int); // this is the base case Else(ReverseOrder_TheCounterpart, C); } datatype ReverseOrder_TheCounterpart { TreeLike(ReverseOrder_TheCounterpart, ReverseOrder_TheCounterpart); More(ReverseOrder_MutuallyRecursiveDataType); } // --------------------- class ArrayTests { ghost method G(a: array) requires a != null && 10 <= |a|; modifies a; { a[7] := 13; // error: array elements are not ghost locations } }