| 1 | module main |
| 2 | |
| 3 | type Expr = Ident | SelectorExpr |
| 4 | |
| 5 | struct Ident { |
| 6 | name string |
| 7 | } |
| 8 | |
| 9 | struct SelectorExpr { |
| 10 | lhs Expr |
| 11 | rhs Expr |
| 12 | // op int |
| 13 | } |
| 14 | |
| 15 | fn main() { |
| 16 | a := Ident{ |
| 17 | name: 'foo' |
| 18 | } |
| 19 | node := Expr(a) |
| 20 | if a.name == 'bar' { |
| 21 | } else if node !in [Ident, SelectorExpr] { |
| 22 | } |
| 23 | } |
| 24 |