i was curious as to why some generated DocC/Unidoc symbol pages are missing certain crucial generic constraints gating the symbols.
to my surprise, i found that lib/SymbolGraphGen ignores associatedtype
constraints entirely when it computes the generic context for a declaration. in the following example, only the Self
constraint is detected by SymbolGraphGen; the RawValue
constraint is ignored entirely.
public
protocol Protocol
{
}
extension Protocol where Self:RawRepresentable, RawValue:Protocol
{
public
func f() { }
}
{
...
"pathComponents": [
"Protocol",
"f()"
],
"swiftGenerics": {
"constraints": [
{
"kind": "conformance",
"lhs": "Self",
"rhs": "RawRepresentable",
"rhsPrecise": "s:SY"
}
]
},
"swiftExtension": {
"extendedModule": "ConditionalDefaultImplementations",
"typeKind": "swift.protocol",
"constraints": [
{
"kind": "conformance",
"lhs": "Self",
"rhs": "RawRepresentable",
"rhsPrecise": "s:SY"
}
]
},
...
},
is there a reason why SymbolGraphGen does not consider associated type constraints when it computes generics?