mirror of
https://github.com/vlang/v.git
synced 2025-09-14 06:52:36 +03:00
parser: fix a bug with complex ref fn args
This commit is contained in:
parent
76c27c0b03
commit
f30d0ce667
4 changed files with 72 additions and 12 deletions
|
@ -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
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue