1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: fix a bug with complex ref fn args

This commit is contained in:
Alexander Medvednikov
2019-11-10 21:54:28 +03:00
parent 76c27c0b03
commit f30d0ce667
4 changed files with 72 additions and 12 deletions

View File

@ -21,6 +21,8 @@ multi line comment (3)
multi line comment (2)
*/
import time
type myfn fn (int) string
type myfn2 fn (a int, b int) int
@ -119,3 +121,29 @@ fn test_fns() {
// no asserts for now, just test function declarations above
}
struct Foo {
}
fn process_foo(foo &Foo) {
}
fn get_foo() Foo {
return Foo{}
}
// This used to be broken.
fn test_ref_fn_arg() {
process_foo(get_foo())
println(3434)
assert true
/*
res := (time.random().calc_unix())
println(res)
assert true
*/
}