Open radeusgd opened 1 month ago
Of course if I remove the Warning.attach
, we do get the expected behaviour. But it should also work the same with warnings attached.
Interestingly also, if I remove the ...
then the first 2 calls now work fine. The third one will fail however because we no longer suspend the default arguments, so I could no longer override arg2
:
Called ((My_Table.Value 1)).union [] with 1 2 3
{Columns = [1, [], 6]}
Called ((My_Table.Value 2)).union [] with 1 2 3
{Columns = [2, [], 6]}
Called ((My_Table.Value 2)).union [] with 1 2 3
Execution finished with an error: Type error: expected a function, but got My_Table.Value.
at <enso> suspending-defaults.main<arg-1>(suspending-defaults.enso:24:14-38)
at <enso> suspending-defaults.main(suspending-defaults.enso:24:5-38)
But this 'proves' that the problematic behaviour is caused by some interaction between both the suspending of default arguments using ...
operator and warnings.
The columns
method is being searched for on (org.enso.interpreter.runtime.callable.function.Function) My_Table.union[e.enso:6-8] self=(My_Table.Value 2) tables=[]
Consider the following repro
suspending-defaults.enso
:Actual behaviour
Running the above script yields:
We can see 2 anomalies here:
union
is executed 3 times (!) (as indicated by the prints) even though it should only happen once. We have a problem with re-running a side-effecting computation - that should never happen!columns
method on it. Even though in the exactly same scenario above such call has worked all fine.The difference between first and second calls is only that the second one contains warnings.
Expected behaviour
The program should print