Variable "i" is simply changed in for's header. To be precise:
for (unsigned int i = 0; i < LightCount; i++)
Where LightCount is uniform variable. I also thought, changing the LightCount to a constant expression like MAX_LIGHTS, which is 30, would help, but no luck. I have tried changing MAX_LIGHTS to lower value, like 3 for example, but still with the same result.
Reading the OpenGL wiki, I found a sentence
Quote
Arrays can be accessed with arbitrary numeric expressions. They do not have to be compile-time constants (though there are a few exceptions to this rule; for example, the very next section).
...where the next section is for opaque types (while the outFrag.LightDir_tan is just an array of vec3). Source:
Link
Lately, I have also discovered, if I had an error, in any of the shaders, that simply causes linking error, the shadow log also returns this error. This one is really weird. Let's say I add some bulshit in fragment shader, even like no semicolon at the end of the line, the error is still in vertex shader, on some different line (which also uses array index). This error is nightmare.