Golang allows one to use (outside) local variables within the code of a function literal.
Technically, this can be supported but would have to be changed by analyzing the type of used variables that are outside the function literal's scope and then passed by reference.
so something like:
var n int
func() {
n++
}()
would have to be like:
void fn(int& param1) {
param1++
}
...
int n;
fn(n);
Golang allows one to use (outside) local variables within the code of a function literal. Technically, this can be supported but would have to be changed by analyzing the type of used variables that are outside the function literal's scope and then passed by reference.
so something like:
would have to be like:
Not impossible but rather difficult to support.