mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
parser/cgen: interface <<; any type
This commit is contained in:
@@ -91,3 +91,11 @@ interface Speaker {
|
||||
speak()
|
||||
}
|
||||
|
||||
|
||||
fn test_interface_array() {
|
||||
mut animals := []Speaker{}
|
||||
animals = [ Cat{}, Dog{} ]
|
||||
animals << Cat{}
|
||||
assert true
|
||||
assert animals.len == 3
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user