~mna/snow

snow/pkg/semantic/testdata/fn_return_struct.snow -rw-r--r-- 192 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
struct S {
  let x: int
  var y: int
  fn z() {}
}

fn newS() -> S {
  var s: S
  return s
}

fn test() {
  newS().x
  newS().y
  newS().z()

  newS().x = 1
  newS().y = 2
  newS().z = test
}