             let kinds = file.syntaxMap.tokensIn(range).flatMap { SyntaxKind(rawValue: $0.type) }
             return kinds.filter { SyntaxKind.commentKinds().contains($0) }.isEmpty
         }.last.flatMap {
-            contents.NSRangeToByteRange(start: $0.location, length: $0.length)
+            contents.bridge().NSRangeToByteRange(start: $0.location, length: $0.length)
         }?.location
     }
 }

    }

    private func trailingCommaIndex(_ contents: String, file: File, offset: Int) -> Int? {
        let range = NSRange(location: 0, length: (contents as NSString).length)
        let ranges = TrailingCommaRule.regex
            .matches(in: contents, options: [], range: range).map { $0.range }


            return []
        }

        let contents = file.contents.bridge()
        if let (startLine, _) = contents.lineAndCharacter(forByteOffset: bodyOffset),
            let (endLine, _) = contents.lineAndCharacter(forByteOffset: lastPosition),
            configuration.mandatoryComma && startLine == endLine {
            // shouldn't trigger if mandatory comma style and is a single-line declaration
            return []
        }

        let length = bodyLength + bodyOffset - lastPosition
        let contentsAfterLastElement = contents.substringWithByteRange(start: lastPosition,
                                                                       length: length) ?? ""

        // if a trailing comma is not present
        guard let commaIndex = trailingCommaIndex(contentsAfterLastElement, file: file,
