Gitly
English
Русский
Español
日本語
中文
Português
Log in
Register
v2
/
vlib
/
v
/
checker
/
tests
/
cannot_cast_to_struct.vv
18
lines
·
14
sloc
·
195 bytes
·
0c8ce3bcb9fd4a2e5bd5f991a5a07da976d780d7
Raw
1
struct Abc {}
2
3
struct Xyz {}
4
5
type Alphabet = Abc | Xyz
6
7
struct Test {
8
abc Alphabet
9
}
10
11
fn main() {
12
_ := Test(Abc{})
13
sum := Alphabet(Xyz{})
14
_ = Xyz(sum)
15
_ = Xyz(5)
16
s := Abc{}
17
_ = Xyz(&s)
18
}
19