         return code
     }
 }
-
-/// Swift code for assigning the raw return value
-public func instanceSetter(for field: GIR.CType, ref: TypeReference, knownRecord: GIR.Record?, indentation: String, _ record: GIR.Record? = nil, target: String = "ptr", ptr parameterName: String = "newValue", castVar: String = "newValue", convertToSwiftTypes doConvert: Bool = false) -> String {
-    guard !field.isVoid else { return "// \(field.name) is Void\n" }
-    let ref = field.containedTypes.first?.typeRef ?? field.typeRef
-    let argPtrName: String
-    if ref.indirectionLevel == 1, let knownRecord = knownRecord {
-        argPtrName = "." + knownRecord.ptrName
-    } else if ref.indirectionLevel == 0 && field.isKnownBitfield {
-        argPtrName = ".value"
-    } else {
-        argPtrName = ""
-    }
-    let e = parameterName + argPtrName
-    let code = ref.cast(expression: e, from: ref.idiomaticType)
-    return "\(target) = \(code)"
-}
-
-
 
 /// Swift code for the parameters of a constructor
 public func constructorParam(_ method: GIR.Method, prefix: String?) -> String {

        let pointee = ptr + ".pointee." + name
        guard field.isReadable || field.isWritable else { return indentation + "// var \(name) is unavailable because it is neigher readable nor writable\n" }
        guard !field.isVoid else { return indentation + "// var \(swname) is unavailable because \(name) is void\n" }
        let ptrLevel = containedTypeRef.indirectionLevel
        let idiomaticRef = containedTypeRef.idiomaticType
        let typeName: String
        if let tupleSize = field.tupleSize {

        }
        let setterCode: String
        if field.isWritable {
            let cast = fieldRef.isVoid ? setterExpression : fieldRef.cast(expression: setterExpression, from: varRef)
            let setterBody = pointee + " = " + cast
            setterCode = swiftCode(field, doubleIndent + "\(deprecated) set {\n" +
                doubleIndent + indentation + setterBody + "\n" +
                doubleIndent + "}\n", indentation: doubleIndent)
