v2 / vlib / v / checker / tests / unknown_comptime_expr.vv
29 lines · 25 sloc · 258 bytes · dbfb9c3a90a4c268d67c0de7aca09e5ddf3cf644
Raw
1fn unknown_at_ct() int {
2 return 0
3}
4
5fn main() {
6 mut foo := 0
7 $if foo == 0 {
8 }
9
10 bar := unknown_at_ct()
11 $if bar == 0 {
12 }
13}
14
15fn if_is() {
16 s := S1{}
17 $if huh.typ is T {
18 }
19 $if s is int {
20 }
21 $if s.i is 5 {
22 }
23 $if s.i is T {
24 }
25}
26
27struct S1 {
28 i int
29}
30