| 1 | struct Struct { |
| 2 | struct_name string |
| 3 | } |
| 4 | |
| 5 | struct Interface { |
| 6 | interface_name string |
| 7 | } |
| 8 | |
| 9 | type Info = Interface | Struct |
| 10 | |
| 11 | fn main() { |
| 12 | mut info := Info{} |
| 13 | info = Struct{ |
| 14 | struct_name: 'Foo' |
| 15 | } |
| 16 | s := info as Struct |
| 17 | println(s.struct_name) |
| 18 | i := info as Interface // wrong |
| 19 | println(i.interface_name) |
| 20 | } |
| 21 |