     /// swift class name for this record
     @inlinable
     var className: String { return swift }
+
+    /// Return the name of the `Ref` struct type correspondingg to the receiver
+    /// - Note this gets prefixed if the record is in a different namespace
+    @inlinable
+    var structNamePrefixedIfNecessary: String {
+        let name = typeRef.type.prefixedWhereNecessary(structName)
+        return name
+    }
 }

            templatePrefix = className
        }
        let templateName = templatePrefix + "T"
        let typeName = isNullable ? (templateName + "?") : templateName
        return typeName
    }

    /// return the swift (known) type of the receiver when passed as an argument
    /// Returns a reference name in case of a known record with a default value
    @inlinable
    var defaultRefTemplateTypeName: String {
        guard let record = knownRecordReference else {
            return argumentTypeName
        }
        let templateName: String
        if allowNone {
            let refName = record.structName
            templateName = record.typeRef.type.prefixedWhereNecessary(refName)
        } else {
            let className = record.className
            let prefix = typeRef.type.dottedPrefix
            let normalisedPrefix = prefix.asNormalisedPrefix
            let templatePrefix: String
            if GIR.dottedPrefix != prefix && GIR.dottedPrefix != normalisedPrefix {
                templatePrefix = typeRef.type.namespace + className.capitalised
            } else {
                templatePrefix = className
            }
            templateName = templatePrefix + "T"
        }
        let typeName = isNullable ? (templateName + "?") : templateName
        return typeName
    }
}

    }

    /// return the swift (known) type of the receiver when passed as an argument
    /// Returns a struct `Ref` name in case of a known record
    /// - Note this gets prefixed if the record is in a different namespace
    @inlinable
    var knownRecordStructName: String {
        guard let record = knownRecordReference else {
            return argumentTypeName
        }
        let typeName = record.structNamePrefixedIfNecessary
        return typeName
    }

    /// return the swift (known) type of the receiver when passed as an argument
    /// Returns a(n optional, if nullable) struct `Ref` name in case of a known record
    /// - Note this gets prefixed if the record is in a different namespace
    @inlinable
    var knownRecordArgumentTypeName: String {
        guard let record = knownRecordReference else {
            return argumentTypeName
        }
        let typeName = optionalIfNullableOrOptional(record.structNamePrefixedIfNecessary)
        return typeName
    }

    /// return the swift (known) type of the receiver when passed as an argument
    /// for a `@convention(c)` callback
    @inlinable
    var callbackArgumentTypeName: String {
