~mna/snow

snow/pkg/semantic/testdata/fn_call_with_labels.snow -rw-r--r-- 284 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
17
18
19
20
21
fn add(x: int, y: int) -> int {
  return x + y
}

struct S {
  fn do(z: int) {
  }
}

fn main() {
  add(x: 1, y: 2)
  # without works too
  add(1, 2)
  # within parens works too
  ((add))(x: 3, y: 4)
  # in a selector works too
  var s: S
  s.do(z: 5)
  # combined
  ((s).do)(z: 6)
}