mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: fix alloc empty struct array error (#14007)
This commit is contained in:
@ -300,3 +300,15 @@ fn test_alias_string_contains() {
|
||||
names := [Str('')]
|
||||
assert (Str('') in names) == true
|
||||
}
|
||||
|
||||
struct XYZ {}
|
||||
|
||||
fn test_array_append_empty_struct() {
|
||||
mut names := []XYZ{cap: 2}
|
||||
names << XYZ{}
|
||||
assert (XYZ{} in names) == true
|
||||
|
||||
// test fixed array
|
||||
array := [XYZ{}]
|
||||
assert (XYZ{} in names) == true
|
||||
}
|
||||
|
Reference in New Issue
Block a user