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:
@ -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
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user