| 1 | struct Abc { |
| 2 | def Def |
| 3 | } |
| 4 | |
| 5 | struct Def { |
| 6 | ch chan string |
| 7 | } |
| 8 | |
| 9 | fn test_struct_init_with_chan_field() { |
| 10 | abc1 := Abc{Def{}} |
| 11 | println('printing abc1') |
| 12 | println(abc1) // this works |
| 13 | |
| 14 | abc2 := Abc{} |
| 15 | println('printing abc2') |
| 16 | println(abc2) // this gives invalid memory access |
| 17 | |
| 18 | assert '${abc1}' == '${abc2}' |
| 19 | } |
| 20 |