Skip to content

Commit

Permalink
tests: add test for cast as selector fix (see also #20717) (#20722)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipensp committed Feb 3, 2024
1 parent f72f1fc commit abd2b64
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions vlib/v/tests/as_cast_selector_test.v
@@ -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
}

0 comments on commit abd2b64

Please sign in to comment.