vxx2 / vlib / v / checker / tests / infix_is_notis_interface_unimplemented_err.vv
28 lines · 22 sloc · 319 bytes · 5c7ceb16dde968b329c53e122126da52a759d657
Raw
1fn f() ?int {
2 return none
3}
4
5fn type_unimplemented_ierror() {
6 if _ := f() {
7 } else {
8 _ = err is int
9 }
10
11 _ = f() or {
12 _ = err is int
13 0
14 }
15}
16
17interface IAbc {
18 some_method()
19}
20
21struct Struct {}
22
23fn (s Struct) some_method() {}
24
25fn type_unimplemented_interface() {
26 ivalue := IAbc(Struct{})
27 _ := ivalue is int
28}
29