| 1 | import net |
| 2 | |
| 3 | fn accept_mut_tcp_conn(mut conn net.TcpConn) bool { |
| 4 | return true |
| 5 | } |
| 6 | |
| 7 | fn test_nested_map_tcpconn_reference_value_for_in_mut_type() { |
| 8 | mut con_list := map[string]map[string]&net.TcpConn{} |
| 9 | conn := &net.TcpConn{} |
| 10 | con_list['foo'] = { |
| 11 | 'bar': conn |
| 12 | } |
| 13 | |
| 14 | for _, mut connection in unsafe { con_list['foo'] } { |
| 15 | assert typeof(connection).name == '&net.TcpConn' |
| 16 | assert accept_mut_tcp_conn(mut connection) |
| 17 | assert voidptr(connection) == voidptr(conn) |
| 18 | } |
| 19 | } |
| 20 |