I mean any string is system.string. That's where the type is defined. Your problem seems to be that in your loop `for n in ...` you call `toLayer(layer...)` and I can't seem to make out where you actually define a `layer` variable anywhere.
Alternatively, based on the error message if you defined layer elsewhere and just didn't copy paste it here: Might be that you stumbled over `Table` not being a `var Table` (and thus immutable) ?
