Problems with Iterating over a javascript generic list and #pragma strict

Hi all,

I’m trying to loop over a list of strings using a for loop…

for(var eventType : String in registeredEventTypes)
{
}

where registeredEventTypes is declared as:

private var registeredEventTypes : List.<String>;

and I’m using #pragma strict.

For some reason it doesn’t like the for loop, and it comes up with the error ‘Cannot convert Object to String’, and I cannot work out why.

Any help would be greatly appreciated.

Wibbs

My searchfu obviously failed me - #pragma downcast appears to be the answer, but I’m not entirely sure why. The other thing I don’t understand is why this is even necessary - I thought that using generic lists with explict types would prevent any casting being needed.