| 1 | interface IValue {} |
| 2 | |
| 3 | struct Null {} |
| 4 | |
| 5 | struct MyInt { |
| 6 | val int |
| 7 | } |
| 8 | |
| 9 | fn test_array_init_with_interface_implicit_cast() { |
| 10 | // Test that array init with interface element type allows implicit cast |
| 11 | a := []IValue{len: 3, init: Null{}} |
| 12 | assert a.len == 3 |
| 13 | |
| 14 | b := []IValue{len: 2, init: MyInt{42}} |
| 15 | assert b.len == 2 |
| 16 | } |
| 17 |