mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
checker: fix generic_mutable_arrays in functions (#8445)
This commit is contained in:
parent
64d12cdc8d
commit
c5e7956eb5
2 changed files with 10 additions and 1 deletions
|
@ -1359,3 +1359,12 @@ fn test_clone_of_same_elem_size_array() {
|
|||
println(arr2)
|
||||
assert arr2 == [Abc{1, 2, 3}, Abc{2, 3, 4}]
|
||||
}
|
||||
|
||||
pub fn example<T>(mut arr []T) []T {
|
||||
return arr.clone()
|
||||
}
|
||||
|
||||
fn test_generic_mutable_arrays() {
|
||||
mut arr := [1, 2, 3]
|
||||
assert example(mut arr) == [1, 2, 3]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue