mirror of
https://github.com/vlang/v.git
synced 2025-09-13 09:25:45 -04:00
parent
f72f1fc893
commit
abd2b64700
18
vlib/v/tests/as_cast_selector_test.v
Normal file
18
vlib/v/tests/as_cast_selector_test.v
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
struct Foo {
|
||||||
|
mut:
|
||||||
|
x int
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Bar {
|
||||||
|
mut:
|
||||||
|
y int
|
||||||
|
}
|
||||||
|
|
||||||
|
type Foobar = Bar | Foo
|
||||||
|
|
||||||
|
fn test_main() {
|
||||||
|
mut bar := Foobar(Bar{
|
||||||
|
y: 123
|
||||||
|
})
|
||||||
|
assert bar as Bar.y == 123
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user