vxx2 / vlib / v / checker / tests / incorrect_smartcast_err.vv
15 lines · 13 sloc · 179 bytes · 0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1interface IExample {
2}
3
4struct Example {
5 field string
6}
7
8fn main() {
9 mut example := IExample(Example{
10 field: 'test'
11 })
12 if example is Example {
13 println(example.field)
14 }
15}
16