v/vlib/v/checker/tests/is_type_invalid.vv

22 lines
234 B
V

type IoS = int | string
interface Animal {
speak()
}
struct Dog {}
fn (d Dog) speak() {}
struct Cat {}
fn main() {
if IoS(1) is u8 {
println('not cool')
}
a := Animal(Dog{})
if a is Cat {
println('not cool either')
}
}