summaryrefslogtreecommitdiff
path: root/Test/hofs/LambdaParsefail.dfy
blob: 3dc30100223e8a983abce52939a76e57ee95b7cb (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
// RUN: %dafny /print:"%t.print" "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

method Fails() { // all these fail
    var g1 := x.x => x;
    var g2 := x() => x;
    var g3 := ((x)) => x;
    var g4 := _a => 5;
    var g5 := x : int => x;
}

// the rest of these are OK:

function f():() {
  a.b(x); a.b(x)
}

method M() {
  g := a.b(x);
}

method M() {
  g := y => a(y);
}

method M() {
  g := y => a.b(y);
}

function f():() {
  (u => a.b(x); a(x))(); a(x)
}