         guard let record = knownRecordReference else {
             return argumentTypeName
         }
+        let typeName = optionalIfNullableOrOptional(templateName(for: record))
+        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 {
+            templateName = record.structNamePrefixedIfNecessary
+        } else {
+            templateName = self.templateName(for: record)
+        }
+        let typeName = optionalIfNullableOrOptional(templateName)
+        return typeName
+    }
+
+    /// Return the name of a templated type correspondingg to a given record
+    /// - Note this gets prefixed if the record is in a different namespace
+    /// - Parameter record: A record for which to create a template name
+    /// - Returns: A string representing a template type for the given record
+    @inlinable
+    func templateName(for record: GIR.Record) -> String {
         let className = record.className
         let prefix = typeRef.type.dottedPrefix
         let normalisedPrefix = prefix.asNormalisedPrefix

    }

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

            templatePrefix = className
        }
        let templateName = templatePrefix + "T"
        return templateName
    }

    /// Append a question mark if the receiver is nullable
    /// - Parameter templateName: The string to optionally turn into an optional
    /// - Returns: The original string, with or without a `?` appended
    @inlinable func optionalIfNullableOrOptional(_ typeName: String) -> String {
        let typeName = isNullable || isOptional ? (typeName + "?") : typeName
        return typeName
    }
}
