v2 / vlib / v / tests / interfaces / empty_interface_test.v
14 lines · 12 sloc · 191 bytes · 6488041a749df9762348d019c4223908c476f2e2
Raw
1interface Any {}
2
3fn print_out(x Any) string {
4 if x is string {
5 println(x)
6 return '${x}'
7 }
8 return ''
9}
10
11fn test_empty_interface() {
12 ret := print_out('12345')
13 assert ret == '12345'
14}
15