Skip to content

Commit 0a035c5

Browse files
authored
add missing memberwise initializers to Mixins (#52)
1 parent da6cedd commit 0a035c5

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Sources/SymbolKit/SymbolGraph/Symbol/FunctionSignature/FunctionSignature.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ extension SymbolGraph.Symbol {
3030
*/
3131
public var returns: [DeclarationFragments.Fragment]
3232

33+
public init(parameters: [SymbolGraph.Symbol.FunctionSignature.FunctionParameter], returns: [SymbolGraph.Symbol.DeclarationFragments.Fragment]) {
34+
self.parameters = parameters
35+
self.returns = returns
36+
}
37+
3338
public init(from decoder: Decoder) throws {
3439
let container = try decoder.container(keyedBy: CodingKeys.self)
3540
parameters = try container.decodeIfPresent([FunctionParameter].self, forKey: .parameters) ?? []

Sources/SymbolKit/SymbolGraph/Symbol/Swift/Extension.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ extension SymbolGraph.Symbol.Swift {
4444
case typeKind
4545
case constraints
4646
}
47+
48+
public init(extendedModule: String, typeKind: SymbolGraph.Symbol.KindIdentifier? = nil, constraints: [SymbolGraph.Symbol.Swift.GenericConstraint]) {
49+
self.extendedModule = extendedModule
50+
self.typeKind = typeKind
51+
self.constraints = constraints
52+
}
4753

4854
public init(from decoder: Decoder) throws {
4955
let container = try decoder.container(keyedBy: CodingKeys.self)

Sources/SymbolKit/SymbolGraph/Symbol/Swift/Generics.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ extension SymbolGraph.Symbol.Swift {
4747
There is a *conformance constraint* involving `S`.
4848
*/
4949
public var constraints: [GenericConstraint]
50+
51+
public init(parameters: [SymbolGraph.Symbol.Swift.GenericParameter], constraints: [SymbolGraph.Symbol.Swift.GenericConstraint]) {
52+
self.parameters = parameters
53+
self.constraints = constraints
54+
}
5055

5156
public init(from decoder: Decoder) throws {
5257
let container = try decoder.container(keyedBy: CodingKeys.self)

0 commit comments

Comments
 (0)