summaryrefslogtreecommitdiff
path: root/Test/dafny0/CallStmtTests.dfy
blob: 46c466ff5b3655cfeeb1f02e39eb09a1a0c82b23 (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
// RUN: %dafny /compile:0 /print:"%t.print" /dprint:"%t.dprint" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

module M0 {
  method testing1(t: int)
 {
    t := m(); // error: should be checked at the Dafny level, not fall to Boogie.
  }

  method m() returns (r: int)
  {
    return 3;
  }
}

module M1 {
  method testing2()
  {
    var v;
    v := m2(); // error: v needs to be ghost because r is.
  }

  method m2() returns (ghost r: int)
  {
    r := 23;
  }
}