~mna/snow

snow/pkg/codegen/testdata/tuple_as_struct_generic.snow.want -rw-r--r-- 467 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
27
28
29
30
31
32
33
34
35
36
37
package main

import "fmt"

type _اSا0 struct {
	_اt struct {
		_ا0 int
		_ا1 bool
		_ا2 string
	}
}

func _اSا0اnew(
	s _اSا0,
	m map[string]bool,
) _اSا0 {
	var r _اSا0
	if m["t"] {
		r._اt = s._اt
	}
	return r
}

func main() {
	var s _اSا0 = _اSا0اnew(_اSا0{_اt: struct {
		_ا0 int
		_ا1 bool
		_ا2 string
	}{1, false, "tuple"}}, map[string]bool{"t": true})
	_اprintln(s._اt._ا2)
}

func _اprintln(
	v string,
) {
	fmt.Println(v)
}