summaryrefslogtreecommitdiff
path: root/Test/dafny4/Bug93.dfy
blob: 5a1dd27f779a27c1123ff7e03acd69ae91e93901 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// RUN: %dafny /compile:0 "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

module Fuel {
    function FunctionA(x:int) : int
    {
        x + 2
    }

    function FunctionB(y:int) : int
    {
        FunctionA(y - 2)
    }

		method {:fuel FunctionA,0,0}  MethodX(z:int)
    {
        assert FunctionB(z) == z; // error: Cannot see the body of FunctionA
    }
}

module Opaque {
    function {:opaque} FunctionA(x:int) : int
    {
        x + 2
    }

    function FunctionB(y:int) : int
    {
        FunctionA(y - 2)
    }

    method MethodX(z:int)
    {
        assert FunctionB(z) == z;
    }
}