The left-hand side of a ‘for…in’ statement cannot use a type annotation

I could be wrong because I’ve only done this with of loops, but you should be able to enforce a type definition on the collection (right side) which informs the typing on the item.

For example:

for (role in roles as Roles[]) 

This should make each element of type Roles.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)