~mna/snow

snow/pkg/codegen/testdata/struct_multi_fields_per_decl.snow -rw-r--r-- 309 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
struct S [$T] {
  var p1: $T, p2: $T, count: int
}

fn main() {
  var s: S[string], i: S[int]

  s = S[string](p1: "a", p2: "b", count: 1)
  i = S[int](p1: 1, p2: 2, count: 2)
  println[S[string]](s)
  println[S[int]](i)
}

@extern(import: "fmt", symbol: "Println")
fn println[$T](v: $T)

#={a b 1}
#={1 2 2}