3 ms·
In Java you can only close over final variables, so you can't close over the loop variable at all. (Unless that changed since last time I used Java, which - gra
by panzi 3y ago
In Java you can only close over final variables, so you can't close over the loop variable at all. (Unless that changed since last time I used Java, which - granted - was a long time ago.)
- doctor_eval 3y agoThe problem being fixed doesn’t affect only closures, but the body of the for loop itself. So for example taking the address of the loop variable would unexpectedly return the same value for the duration of the loop.