Foundation objects are not bridged on Linux as they are on macOS. This Swift JIRA Report goes into more detail. Hopefully, this is fixed at some point, but in the mean time switch:

    let foo: String = "foo"
    let bar: NSString = foo as NSString

with:

   let foo: String = "foo"
   let bar: NSString = NSString(string: foo)