0 issues 1 contributor 4 branches 0 releases
Additions: 18 Deletions: 1 View patch
1 } else if (p.tok.kind == .name && !(p.tok.lit == 'C' && p.peek_tok.kind == .dot)
2 && (((ast.builtin_type_names_matcher.matches(p.tok.lit) || p.tok.lit[0].is_capital())
3 && p.peek_tok.kind != .lpar) || (p.peek_tok.kind == .dot && p.peek_token(2).lit.len > 0
4- && p.peek_token(2).lit[0].is_capital()))) || p.is_only_array_type() {
5+ && p.peek_token(2).lit[0].is_capital()))) || p.is_only_array_type()
6+ || p.tok.lit == 'fn' {
7 mut types := []ast.Type{}
8 for {
9 // Sum type match
10
1 Fn(fn (int) int)
2 123
3 123
4+123
5+321
6 321
7 321
8
1 println(x1())
2 }
3
4+ match x1 {
5+ fn () int {
6+ println(x1())
7+ }
8+ else {}
9+ }
10+
11 x2 := abc(2)
12 y2 := x2 as fn (int) int
13 println(y2(321))
14 if x2 is fn (int) int {
15 println(x2(321))
16 }
17+
18+ match x2 {
19+ fn (int) int {
20+ println(x2(321))
21+ }
22+ else {}
23+ }
24 }
25