2020-01-07 14:58:24 +03:00
|
|
|
import time.misc as tmisc
|
2019-11-11 17:59:59 +03:00
|
|
|
// using a manual temporary intermediate variable should always work:
|
2020-01-07 14:58:24 +03:00
|
|
|
fn test_call_fn_that_requires_reference_with_function_that_returns_a_struct_manual() {
|
|
|
|
t1 := tmisc.random()
|
2019-11-11 17:59:59 +03:00
|
|
|
t2 := t1.calc_unix()
|
2020-01-07 14:58:24 +03:00
|
|
|
println('res: $t2')
|
2019-11-11 17:59:59 +03:00
|
|
|
assert true
|
|
|
|
}
|
|
|
|
|
2020-01-07 14:58:24 +03:00
|
|
|
/*
|
|
|
|
// TODO: Fix this.
|
2019-11-11 17:59:59 +03:00
|
|
|
// v should produce temporary intermediate variables in chained calls:
|
|
|
|
fn test_call_fn_that_requires_reference_with_function_that_returns_a_struct_chained(){
|
2020-01-07 14:58:24 +03:00
|
|
|
res := (tmisc.random().calc_unix())
|
2019-11-11 17:59:59 +03:00
|
|
|
println('res: $res')
|
|
|
|
assert true
|
|
|
|
}
|
|
|
|
*/
|