~mna/snow

snow/pkg/semantic/testdata/fn_complex_selectors.snow -rw-r--r-- 308 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
22
23
24
25
26
struct S {
  var s1: int
  var s2: T

  struct T {
    var t1: string

    fn do() -> (int, ()->int) {
      fn func() -> int {
        return 1
      }
      return (3, func)
    }
  }
}

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

fn main() {
  create().s2.t1
  create().s2.do().0
  create().s2.do().1()
}