ersin_ertan
10/05/2017, 7:26 PMInternal error occurred when analyzing this expression
Note: the second line returns a string, instead of both cases of the fold returning int
Try.invoke { if(true) 2 else throw Exception() }.fold({ t:Throwable -> 4 }, { i:Int -> i})
Try.invoke { if(true) 2 else throw Exception() }.fold({ t:Throwable -> "a" }, { i:Int -> i})
And even if you change the second line's if to false and print the results, it will run despite the error, returning 2 and "a"