v/vlib/v/tests/fn_expecting_ref_but_return...

20 lines
523 B
V
Raw Normal View History

import time.misc as tmisc
2020-04-12 01:41:26 +02:00
// 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()
2020-03-22 19:43:59 +01:00
t2 := t1.unix_time()
println('res: $t2')
assert true
}
/*
// TODO: Fix this.
// v should produce temporary intermediate variables in chained calls:
2020-04-12 01:41:26 +02:00
fn test_call_fn_that_requires_reference_with_function_that_returns_a_struct_chained() {
2020-03-22 19:43:59 +01:00
res := (tmisc.random().unix_time())
println('res: $res')
assert true
}
*/