1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/compiler/tests/fn_expecting_ref_but_returning_struct_time_module_test.v
Delyan Angelov 6d30697d9b time: move time.random() to time.misc module
avoids importing rand to programs that do not need pseudo random generation).
2020-01-07 12:58:24 +01:00

19 lines
521 B
V

import time.misc as tmisc
// using a manual temporary intermediate variable should always work:
fn test_call_fn_that_requires_reference_with_function_that_returns_a_struct_manual() {
t1 := tmisc.random()
t2 := t1.calc_unix()
println('res: $t2')
assert true
}
/*
// TODO: Fix this.
// v should produce temporary intermediate variables in chained calls:
fn test_call_fn_that_requires_reference_with_function_that_returns_a_struct_chained(){
res := (tmisc.random().calc_unix())
println('res: $res')
assert true
}
*/