~mna/snow unlisted

snow/pkg/parser/testdata/generics.snow -rw-r--r-- 226 bytes
424066c5Martin Angers doc: v0.0.5 1 year, 5 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
fn max [$T] (v1: $T, v2: $T) -> $T {
  if v1 > v2 {
    return v1
  }
  return v2
}

struct S [$T, $U] {
  var tt: $T 
  let uu: $U
}

fn main() {
  let z: int = max[int](1, 2)
  let s = S [string, bool ](tt: "a", uu: true)
}