             } else {
                 fname = fullname
             }
+            let arguments = method.args
+            let templateTypes = arguments.compactMap(\.templateDecl).asSet.joined(separator: ", ")
+            let templateDecl = templateTypes.isEmpty ? "" : ("<" + templateTypes + ">")
             let p: String? = consPrefix == firstArgName?.swift ? nil : consPrefix
-            let fact = factory ? "static func \(fname.swift)(" : "\(isOverride ? ovr : conv)init!("
+            let fact = factory ? "static func \(fname.swift + templateDecl)(" : ("\(isOverride ? ovr : conv)init!" + templateDecl + "(")
             let code = swiftCode(method, indentation + "\(deprecated)@inlinable \(publicDesignation)\(fact)" +
                 constructorParam(method, prefix: p) + ")\(returnDeclaration(method)) {\n" +
                     doubleIndent + call(method) +


/// Swift code for auto-prefixed arguments
public func parameterCode(for argument: GIR.Argument) -> String {
    let prefixedname = argument.prefixedArgumentName
    let type = argument.templateTypeName
    let escaping = type.maybeCallback ? "@escaping " : ""
    let defaultValue = argument.isNullable && argument.allowNone ? " = nil" : ""
    let code = prefixedname + ": " + escaping + type + defaultValue
    return code
}


/// Swift code for method parameters
public func parameterCode(for argument: GIR.Argument, prefix: String) -> String {
    let name = argument.argumentName
    let prefixedName = prefix + " " + name
    let type = argument.templateTypeName
    let escaping = type.maybeCallback ? "@escaping " : ""
    let defaultValue = argument.isNullable && argument.allowNone ? " = nil" : ""
    let code = prefixedName + ": " + escaping + type + defaultValue
    return code
}

