~mna/snow

snow/pkg/semantic/testdata/invalid_ref_fn_assign.snow -rw-r--r-- 204 bytes
424066c5Martin Angers doc: v0.0.5 1 year, 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
struct S {
  ref fn foo() {}
}

fn get_s() -> S {
  return S()
}

fn main() {
  var tup: (int, () -> void)
  var s1 = S()
  let s2 = S()
  tup = (1, s1.foo)
  tup = (2, s2.foo)
  tup = (3, get_s().foo)
}