summaryrefslogtreecommitdiff
path: root/Test/hofs/Field.dfy
blob: 7d3f571d5fd90475cc6f66fca660bee07596683c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// RUN: %dafny "%s" > "%t"
// RUN: %diff "%s.expect" "%t"

// calling fields should not make a resolution error:

class Ref<A> {
  var val: A;
}

method Nope() {
  var f := new Ref<int -> bool>;
  assert f.val(0);
}

class FnRef<A,B> {
  var fn: A -> B;
}

method Nope2() {
  var f := new FnRef<int,bool>;
  assert f.fn(0);
}