| 1 | const default_logger = Example{} |
| 2 | |
| 3 | struct Example { |
| 4 | structs []Another = [Another{}] |
| 5 | } |
| 6 | |
| 7 | pub struct Another { |
| 8 | function fn (string) = fn (value string) { |
| 9 | println('${value}') |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | pub fn (e Example) useless() string { |
| 14 | return 'ok' |
| 15 | } |
| 16 | |
| 17 | fn test_anon_fn_redefinition() { |
| 18 | e1 := Example{} |
| 19 | assert e1.useless() == 'ok' |
| 20 | e2 := Example{} |
| 21 | assert e2.useless() == 'ok' |
| 22 | e3 := Example{} |
| 23 | assert e3.useless() == 'ok' |
| 24 | } |
| 25 |