v/vlib/v/checker/tests/no_interface_str.vv

20 lines
179 B
V

interface Animal {
speak()
}
struct Cow {
}
fn (c Cow)speak() {
println('moo')
}
fn get_animal() Animal {
return Cow{}
}
fn moin() {
a := get_animal()
println(a.str())
}