         switch knownType {
         case is GIR.Record:
             if (isNullable || isOptional) {
-                return "arg\(index).flatMap(\(typeRef.type.swiftName)Ref.init(raw:))"
-            }
-            return typeRef.type.swiftName + "Ref" + "(raw: arg\(index))"
+                return "arg\(index).flatMap(\(knownRecordStructName).init(raw:))"
+            }
+            return knownRecordStructName + "(raw: arg\(index))"
         case is GIR.Alias: // use containedTypes
             return ""
         case is GIR.Bitfield:

    func swiftIdiomaticType() -> String {
        switch knownType {
        case is GIR.Record:
            return typeRef.type.swiftName + "Ref" + ((isNullable || isOptional) ? "?" : "")
        case is GIR.Alias: // use containedTypes
            return ""
        case is GIR.Bitfield:
            return self.argumentTypeName + ((isNullable || isOptional) ? "?" : "")
        case is GIR.Enumeration:
            return self.argumentTypeName + ((isNullable || isOptional) ? "?" : "")
        default: // Treat as fundamental (if not a fundamental, report error)
            return self.swiftSignalRef.fullSwiftTypeName + ((isNullable || isOptional) ? "?" : "")
        }
    }


    func swiftCCompatibleType() -> String {
        switch knownType {
        case is GIR.Record:
            return optionalIfNullableOrOptional(GIR.gpointerType.typeName)
        case is GIR.Alias: // use containedTypes
            return ""
        case is GIR.Bitfield, is GIR.Enumeration:
            return optionalIfNullableOrOptional(GIR.uint32Type.typeName)
        default: // Treat as fundamental (if not a fundamental, report error)
            return self.callbackArgumentTypeName
        }
