tests: add test for cast as selector fix (see also #20717) (#20722)

This commit is contained in:
Felipe Pena 2024-02-03 15:25:54 -03:00 committed by GitHub
parent f72f1fc893
commit abd2b64700
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View 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
}